Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/extended/optical/wls/include/WLSTrajectoryPoint.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file WLSTrajectoryPoint.hh
0027 /// \brief Definition of the WLSTrajectoryPoint class
0028 
0029 #ifndef WLSTrajectoryPoint_h
0030 #define WLSTrajectoryPoint_h 1
0031 
0032 #include "G4Allocator.hh"
0033 #include "G4StepStatus.hh"
0034 #include "G4ThreeVector.hh"
0035 #include "G4TrajectoryPoint.hh"
0036 #include "globals.hh"
0037 
0038 class G4Track;
0039 class G4Step;
0040 class G4VProcess;
0041 
0042 class WLSTrajectoryPoint : public G4TrajectoryPoint
0043 {
0044   public:
0045     WLSTrajectoryPoint() = default;
0046     WLSTrajectoryPoint(const G4Track*);
0047     WLSTrajectoryPoint(const G4Step*);
0048     WLSTrajectoryPoint(const WLSTrajectoryPoint& right);
0049     ~WLSTrajectoryPoint() override = default;
0050 
0051     inline void* operator new(size_t);
0052     inline void operator delete(void* aTrajectoryPoint);
0053     inline G4bool operator==(const WLSTrajectoryPoint& right) const { return (this == &right); };
0054 
0055     inline G4double GetTime() const { return fTime; };
0056     inline const G4ThreeVector GetMomentum() const { return fMomentum; };
0057     inline G4StepStatus GetStepStatus() const { return fStepStatus; };
0058     inline G4String GetVolumeName() const { return fVolumeName; };
0059 
0060     const std::map<G4String, G4AttDef>* GetAttDefs() const override;
0061     std::vector<G4AttValue>* CreateAttValues() const override;
0062 
0063   private:
0064     G4double fTime = 0.;
0065     G4ThreeVector fMomentum;
0066     G4StepStatus fStepStatus = fUndefined;
0067     G4String fVolumeName;
0068 };
0069 
0070 extern G4ThreadLocal G4Allocator<WLSTrajectoryPoint>* WLSTrajPointAllocator;
0071 
0072 inline void* WLSTrajectoryPoint::operator new(size_t)
0073 {
0074   if (!WLSTrajPointAllocator) WLSTrajPointAllocator = new G4Allocator<WLSTrajectoryPoint>;
0075   return (void*)WLSTrajPointAllocator->MallocSingle();
0076 }
0077 
0078 inline void WLSTrajectoryPoint::operator delete(void* aTrajectoryPoint)
0079 {
0080   WLSTrajPointAllocator->FreeSingle((WLSTrajectoryPoint*)aTrajectoryPoint);
0081 }
0082 
0083 #endif