Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4ScintillationQuasiTrackInfo.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 // Class Description:
0026 //
0027 // Concrete implementation of G4VAuxiliaryTrackInformation used to store
0028 // metadata associated with a quasi-scintillation track generated during
0029 // the Scintillation process.
0030 //
0031 // This class is intended to be attached to a G4Track of G4QuasiOpticalPhoton
0032 // via G4Track::SetAuxiliaryTrackInformation(modelId, this) where modelId
0033 // is obtained by G4PhysicsModelCatalog::GetModelID("model_Scintillation")
0034 // The stored information can later be retrieved using:
0035 // G4Track::GetAuxiliaryTrackInformation(modelId).           
0036 //
0037 #ifndef G4ScintillationQuasiTrackInfo_h
0038 #define G4ScintillationQuasiTrackInfo_h
0039 
0040 #include "G4Allocator.hh"
0041 #include "G4QuasiOpticalData.hh"
0042 #include "G4VAuxiliaryTrackInformation.hh"
0043 
0044 class G4ScintillationQuasiTrackInfo : public G4VAuxiliaryTrackInformation
0045 {
0046  public:
0047   // Construct with scintillation quasi optical data and auxiliary information
0048   explicit G4ScintillationQuasiTrackInfo(const G4QuasiOpticalData& data,
0049                              G4double scint_time,
0050                                          G4double rise_time);
0051 
0052   ~G4ScintillationQuasiTrackInfo() override = default;
0053 
0054   // Required by G4VAuxiliaryTrackInformation
0055   void* operator new(size_t);
0056   void operator delete(void* aScintillationTI);
0057 
0058   // Copy Constructor/instruction
0059   G4ScintillationQuasiTrackInfo(const G4ScintillationQuasiTrackInfo&) = default;
0060   G4ScintillationQuasiTrackInfo& operator=(
0061     const G4ScintillationQuasiTrackInfo&) = default;
0062 
0063   void Print() const override;
0064 
0065   G4QuasiOpticalData GetQuasiOpticalData() const { return fQuasiOpticalData; }
0066   G4double GetScintTime() const { return fScintTime; }
0067   G4double GetRiseTime() const { return fRiseTime; }
0068   
0069   // Static class allowing to check if a G4VAuxiliaryTrackInformation is a
0070   // G4ScintillationQuasiTrackInfo and cast it without changing the pointer
0071   // of the pointed data.
0072   static G4ScintillationQuasiTrackInfo* Cast(
0073     const G4VAuxiliaryTrackInformation* const);
0074 
0075  private:
0076   G4QuasiOpticalData fQuasiOpticalData; // Common optical data
0077   G4double fScintTime{};  // Scintillation decay time constant
0078   G4double fRiseTime{};  // Scintillation rise time constant
0079 };
0080 
0081 ///
0082 // Inline methods
0083 // Implementation adapted from G4ScintillationTrackInformation
0084 ///
0085 
0086 #if defined G4EM_ALLOC_EXPORT
0087 extern G4DLLEXPORT G4Allocator<G4ScintillationQuasiTrackInfo>*&
0088 aScintillationATIAllocator();
0089 #else
0090 extern G4DLLIMPORT G4Allocator<G4ScintillationQuasiTrackInfo>*&
0091 aScintillationATIAllocator();
0092 #endif
0093 
0094 inline void* G4ScintillationQuasiTrackInfo::operator new(size_t)
0095 {
0096   if(aScintillationATIAllocator() == nullptr)
0097   {
0098     aScintillationATIAllocator() =
0099       new G4Allocator<G4ScintillationQuasiTrackInfo>;
0100   }
0101   return (void*) aScintillationATIAllocator()->MallocSingle();
0102 }
0103 
0104 inline void G4ScintillationQuasiTrackInfo::operator delete(
0105   void* aScintillationATI)
0106 {
0107   aScintillationATIAllocator()->FreeSingle(
0108     (G4ScintillationQuasiTrackInfo*) aScintillationATI);
0109 }
0110 
0111 #endif  // G4ScintillationQuasiTrackInfo_h