Loading...
Searching...
No Matches
WLSTrajectory.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/// \file optical/wls/include/WLSTrajectory.hh
28/// \brief Definition of the WLSTrajectory class
29//
30
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
32//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
33
34#ifndef WLSTrajectory_h
35#define WLSTrajectory_h 1
36
37#include "globals.hh"
38#include "G4Allocator.hh"
39#include "G4ParticleDefinition.hh"
40#include "G4Step.hh"
41#include "G4Track.hh"
42#include "G4TrajectoryPoint.hh"
43#include "G4VTrajectory.hh"
44
45#include <vector>
46
47typedef std::vector<G4VTrajectoryPoint*> WLSTrajectoryPointContainer;
48
49class WLSTrajectory : public G4VTrajectory
50{
51 public:
52 WLSTrajectory() = default;
53 WLSTrajectory(const G4Track*);
55 ~WLSTrajectory() override;
56
57 inline void* operator new(size_t);
58 inline void operator delete(void*);
59 inline int operator==(const WLSTrajectory& right) const
60 {
61 return (this == &right);
62 }
63
64 inline G4int GetTrackID() const override { return fTrackID; }
65 inline G4int GetParentID() const override { return fParentID; }
66 inline G4String GetParticleName() const override { return fParticleName; }
67 inline G4double GetCharge() const override { return fPDGCharge; }
68 inline G4int GetPDGEncoding() const override { return fPDGEncoding; }
69 inline G4ThreeVector GetInitialMomentum() const override
70 {
71 return fInitialMomentum;
72 }
73
74 void ShowTrajectory(std::ostream& os = G4cout) const override;
75 void AppendStep(const G4Step* aStep) override;
76 void MergeTrajectory(G4VTrajectory* secondTrajectory) override;
77
79
80 int GetPointEntries() const override { return fpPointsContainer->size(); }
81 G4VTrajectoryPoint* GetPoint(G4int i) const override
82 {
83 return (*fpPointsContainer)[i];
84 }
85
86 const std::map<G4String, G4AttDef>* GetAttDefs() const override;
87 std::vector<G4AttValue>* CreateAttValues() const override;
88
89 private:
91
92 G4int fTrackID = 0;
93 G4int fParentID = 0;
94 G4double fPDGCharge = 0.;
95 G4int fPDGEncoding = 0;
97 G4ThreeVector fInitialMomentum;
98
100};
101
103
104inline void* WLSTrajectory::operator new(size_t)
105{
108 return (void*) WLSTrajectoryAllocator->MallocSingle();
109}
110
111inline void WLSTrajectory::operator delete(void* aTrajectory)
112{
113 WLSTrajectoryAllocator->FreeSingle((WLSTrajectory*) aTrajectory);
114}
115
116#endif
G4ThreadLocal G4Allocator< WLSTrajectory > * WLSTrajectoryAllocator
std::vector< G4VTrajectoryPoint * > WLSTrajectoryPointContainer
int operator==(const WLSTrajectory &right) const
int GetPointEntries() const override
void ShowTrajectory(std::ostream &os=G4cout) const override
G4int GetTrackID() const override
G4int GetPDGEncoding() const override
G4ThreeVector fInitialMomentum
WLSTrajectoryPointContainer * fpPointsContainer
std::vector< G4AttValue > * CreateAttValues() const override
G4ParticleDefinition * GetParticleDefinition()
G4ParticleDefinition * fParticleDefinition
G4VTrajectoryPoint * GetPoint(G4int i) const override
void MergeTrajectory(G4VTrajectory *secondTrajectory) override
G4int GetParentID() const override
G4double GetCharge() const override
~WLSTrajectory() override
G4String GetParticleName() const override
G4ThreeVector GetInitialMomentum() const override
G4String fParticleName
G4double fPDGCharge
const std::map< G4String, G4AttDef > * GetAttDefs() const override
void AppendStep(const G4Step *aStep) override
WLSTrajectory()=default

Applications | User Support | Publications | Collaboration