Geant4  10.03
G4VMoleculeCounter.hh
Go to the documentation of this file.
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 // G4VMoleculeCounter.hh
27 // Geant4
28 //
29 // Created by Mathieu Karamitros on 02/11/2016.
30 //
31 //
32 
33 #ifndef G4VMoleculeCounter_h
34 #define G4VMoleculeCounter_h
35 
36 #include <G4Types.hh>
37 #include <G4ios.hh>
38 #include "G4ThreeVector.hh"
39 
42 
44 protected:
46  static G4bool fUse;
47 
49  virtual ~G4VMoleculeCounter(){}
50 
51 public:
52  static void SetInstance(G4VMoleculeCounter*);
53  static void DeleteInstance();
54 
55  /*
56  * If no instance of G4VMoleculeCounter is provided
57  * then use G4MoleculeCounter
58  */
59  static G4VMoleculeCounter* Instance();
60  static void InitializeInstance();
61 
62  /*
63  * If the molecule counter is used, it will be called
64  * at every creation/deletion of a molecule to
65  * to increase/decrease the number at a given time.
66  */
67  static void Use(G4bool flag = true);
68  static G4bool InUse();
69 
70  //----------------------------------------------------
71 
72  virtual void Initialize() = 0;
73 
74  virtual void ResetCounter() = 0;
75 
77  G4double time,
78  const G4ThreeVector* position = nullptr,
79  int number = 1) = 0;
80 
82  G4double time,
83  const G4ThreeVector* position = nullptr,
84  int number = 1) = 0;
85 
86  /* The dynamics of the given molecule won't be saved into memory.*/
87  virtual void DontRegister(const G4MoleculeDefinition*){}
88  virtual bool IsRegistered(const G4MoleculeDefinition*){
89  return false;
90  }
91  virtual void RegisterAll(){}
92 };
93 
94 #endif /* G4VMoleculeCounter_h */
The pointer G4MolecularConfiguration will be shared by all the molecules having the same molecule def...
CLHEP::Hep3Vector G4ThreeVector
#define G4ThreadLocal
Definition: tls.hh:89
virtual void DontRegister(const G4MoleculeDefinition *)
static void InitializeInstance()
#define position
Definition: xmlparse.cc:622
bool G4bool
Definition: G4Types.hh:79
virtual void RemoveAMoleculeAtTime(G4MolecularConfiguration *, G4double time, const G4ThreeVector *position=nullptr, int number=1)=0
virtual void AddAMoleculeAtTime(G4MolecularConfiguration *, G4double time, const G4ThreeVector *position=nullptr, int number=1)=0
static G4VMoleculeCounter * Instance()
static G4ThreadLocal G4VMoleculeCounter * fpInstance
virtual void ResetCounter()=0
virtual void Initialize()=0
static void SetInstance(G4VMoleculeCounter *)
static void Use(G4bool flag=true)
virtual bool IsRegistered(const G4MoleculeDefinition *)
static void DeleteInstance()
double G4double
Definition: G4Types.hh:76
virtual void RegisterAll()
static G4bool InUse()