Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ScintillationTrackInformation.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 //
27 // $Id: G4ScintillationTrackInformation.hh ????? 2016-01-21 ??:??:??? ?????? $
28 //
29 // Author : Valentin Libioulle valentin.libioulle@usherbrooke.ca (3IT - GRAMS)
30 //
31 //---------------------------------------------------------------
32 //
33 // G4ScintillationTrackInformation
34 //
35 // Class Description:
36 //
37 // Concrete class of G4VUserTrackInformation used to store information
38 // linked to the track generated in a scintillation process.
39 //
40 
41 #ifndef G4SCINTILLATIONTRACKINFORMATION_H
42 #define G4SCINTILLATIONTRACKINFORMATION_H
43 
45 
46 // Represents the scintillation type used to create the track (opticalphoton).
48 
50 {
51  public:
52 
55 
56  // Required by G4VUserTrackInformation
57  void *operator new(size_t);
58  void operator delete(void *aScintillationTI);
59 
60  // Copy Constructor/instruction
62  G4ScintillationTrackInformation& operator=(const G4ScintillationTrackInformation&);
63 
64  virtual void Print() const override;
65 
66  const G4ScintillationType& GetScintillationType() const {return scintillationType;}
67 
68  // Static class allowing to check if a G4VUserTrackInformation is a
69  // G4ScintillationTrackInformation and cast it without changing the
70  // pointer of the pointed data.
72  static G4ScintillationTrackInformation* Cast(const G4VUserTrackInformation* const);
73 
74  private:
75 
76  G4ScintillationType scintillationType;
77  // String given to G4VUserTrackInformation to identify this concrete class
78  static const G4String BaseType;
79 };
80 
82 // Inline methods
84 
85 #include "G4Allocator.hh"
86 
87 // Forward declaration for the Allocator
89 
90 #if defined G4EM_ALLOC_EXPORT
92 #else
94 #endif
95 
96 inline void* G4ScintillationTrackInformation::operator new(size_t)
97 {
99  return (void *) aScintillationTIAllocator->MallocSingle();
100 }
101 
102 inline void G4ScintillationTrackInformation::operator delete(void *aScintillationTI)
103 {
104  aScintillationTIAllocator->FreeSingle((G4ScintillationTrackInformation *) aScintillationTI);
105 }
106 
107 #endif // G4SCINTILLATIONTRACKINFORMATION_H
static G4bool IsScintillationTrackInformation(const G4VUserTrackInformation *const)
#define G4DLLEXPORT
Definition: G4Types.hh:62
#define G4DLLIMPORT
Definition: G4Types.hh:63
G4ScintillationTrackInformation & operator=(const G4ScintillationTrackInformation &)
#define G4ThreadLocal
Definition: tls.hh:89
const G4ScintillationType & GetScintillationType() const
bool G4bool
Definition: G4Types.hh:79
G4ScintillationTrackInformation(const G4ScintillationType &aType=Slow)
G4DLLIMPORT G4ThreadLocal G4Allocator< G4ScintillationTrackInformation > * aScintillationTIAllocator
static G4ScintillationTrackInformation * Cast(const G4VUserTrackInformation *const)