Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CerenkovQuasiTrackInfo.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// Class Description:
26//
27// Concrete implementation of G4VAuxiliaryTrackInformation used to store
28// metadata associated with a quasi-Cerenkov track generated during the
29// Cerenkov process.
30//
31// This class is intended to be attached to a G4Track of G4QuasiOpticalPhoton
32// via G4Track::SetAuxiliaryTrackInformation(modelId, this) where
33// modelId is obtained by G4PhysicsModelCatalog::GetModelID("model_Cerenkov")
34// The stored information can later be retrieved using:
35// G4Track::GetAuxiliaryTrackInformation(modelId).
36//
37#ifndef G4CerenkovQuasiTrackInfo_h
38#define G4CerenkovQuasiTrackInfo_h
39
40#include "G4Allocator.hh"
41#include "G4QuasiOpticalData.hh"
43
45{
46 public:
48 G4double pre_num_photons,
49 G4double post_num_photons);
50
51 ~G4CerenkovQuasiTrackInfo() override = default;
52
53 // Required by G4VAuxiliaryTrackInformation
54 void* operator new(size_t);
55 void operator delete(void* aCerenkovATI);
56
57 // Copy Constructor/instruction
60
61 void Print() const override;
62
63 G4QuasiOpticalData GetQuasiOpticalData() const { return fQuasiOpticalData; }
64 G4double GetPreNumPhotons() const { return fPreNumPhotons; }
65 G4double GetPostNumPhotons() const { return fPostNumPhotons; }
66
67 // Static class allowing to check if a G4VAuxiliaryTrackInformation is a
68 // G4CerenkovQuasiTrackInfo and cast it without changing the pointer of the
69 // pointed data.
71 const G4VAuxiliaryTrackInformation* const);
72
73 private:
74 G4QuasiOpticalData fQuasiOpticalData; // Common optical data
75 G4double fPreNumPhotons{}; // Average number of photons at the pre-step
76 G4double fPostNumPhotons{}; // Average number of photons at the post-step
77};
78
79///
80// Inline methods:
81// Implementation adapted from G4ScintillationTrackInformation
82///
83
84#if defined G4EM_ALLOC_EXPORT
87#else
90#endif
91
92inline void* G4CerenkovQuasiTrackInfo::operator new(size_t)
93{
94 if(aCerenkovATIAllocator() == nullptr)
95 {
97 }
98 return (void*) aCerenkovATIAllocator()->MallocSingle();
99}
100
101inline void G4CerenkovQuasiTrackInfo::operator delete(void* aCerenkovATI)
102{
103 aCerenkovATIAllocator()->FreeSingle((G4CerenkovQuasiTrackInfo*) aCerenkovATI);
104}
105
106#endif // G4CerenkovQuasiTrackInfo_h
G4DLLIMPORT G4Allocator< G4CerenkovQuasiTrackInfo > *& aCerenkovATIAllocator()
double G4double
Definition G4Types.hh:83
#define G4DLLIMPORT
Definition G4Types.hh:69
#define G4DLLEXPORT
Definition G4Types.hh:68
G4CerenkovQuasiTrackInfo & operator=(const G4CerenkovQuasiTrackInfo &)=default
~G4CerenkovQuasiTrackInfo() override=default
static G4CerenkovQuasiTrackInfo * Cast(const G4VAuxiliaryTrackInformation *const)
G4QuasiOpticalData GetQuasiOpticalData() const
G4CerenkovQuasiTrackInfo(const G4CerenkovQuasiTrackInfo &)=default
G4CerenkovQuasiTrackInfo(const G4QuasiOpticalData &data, G4double pre_num_photons, G4double post_num_photons)