Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4CerenkovQuasiTrackInfo.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-Cerenkov track generated during the 
0029 // Cerenkov process.
0030 //
0031 // This class is intended to be attached to a G4Track of G4QuasiOpticalPhoton
0032 // via G4Track::SetAuxiliaryTrackInformation(modelId, this) where 
0033 // modelId is obtained by G4PhysicsModelCatalog::GetModelID("model_Cerenkov")
0034 // The stored information can later be retrieved using:
0035 // G4Track::GetAuxiliaryTrackInformation(modelId).
0036 //
0037 #ifndef G4CerenkovQuasiTrackInfo_h
0038 #define G4CerenkovQuasiTrackInfo_h
0039 
0040 #include "G4Allocator.hh"
0041 #include "G4QuasiOpticalData.hh"
0042 #include "G4VAuxiliaryTrackInformation.hh"
0043 
0044 class G4CerenkovQuasiTrackInfo : public G4VAuxiliaryTrackInformation
0045 {
0046  public:
0047   explicit G4CerenkovQuasiTrackInfo(const G4QuasiOpticalData& data,
0048                         G4double pre_num_photons,
0049                         G4double post_num_photons);
0050 
0051   ~G4CerenkovQuasiTrackInfo() override = default;
0052 
0053   // Required by G4VAuxiliaryTrackInformation
0054   void* operator new(size_t);
0055   void operator delete(void* aCerenkovATI);
0056 
0057   // Copy Constructor/instruction
0058   G4CerenkovQuasiTrackInfo(const G4CerenkovQuasiTrackInfo&) = default;
0059   G4CerenkovQuasiTrackInfo& operator=(const G4CerenkovQuasiTrackInfo&) = default;
0060 
0061   void Print() const override;
0062 
0063   G4QuasiOpticalData GetQuasiOpticalData() const { return fQuasiOpticalData; }
0064   G4double GetPreNumPhotons() const { return fPreNumPhotons; }
0065   G4double GetPostNumPhotons() const { return fPostNumPhotons; }
0066 
0067   // Static class allowing to check if a G4VAuxiliaryTrackInformation is a
0068   // G4CerenkovQuasiTrackInfo and cast it without changing the pointer of the
0069   // pointed data.
0070   static G4CerenkovQuasiTrackInfo* Cast(
0071     const G4VAuxiliaryTrackInformation* const);
0072 
0073  private:
0074   G4QuasiOpticalData fQuasiOpticalData; // Common optical data 
0075   G4double fPreNumPhotons{};  // Average number of photons at the pre-step
0076   G4double fPostNumPhotons{};  // Average number of photons at the post-step
0077 };
0078 
0079 ///
0080 // Inline methods:
0081 // Implementation adapted from G4ScintillationTrackInformation
0082 ///
0083 
0084 #if defined G4EM_ALLOC_EXPORT
0085 extern G4DLLEXPORT G4Allocator<G4CerenkovQuasiTrackInfo>*&
0086 aCerenkovATIAllocator();
0087 #else
0088 extern G4DLLIMPORT G4Allocator<G4CerenkovQuasiTrackInfo>*&
0089 aCerenkovATIAllocator();
0090 #endif
0091 
0092 inline void* G4CerenkovQuasiTrackInfo::operator new(size_t)
0093 {
0094   if(aCerenkovATIAllocator() == nullptr)
0095   {
0096     aCerenkovATIAllocator() = new G4Allocator<G4CerenkovQuasiTrackInfo>;
0097   }
0098   return (void*) aCerenkovATIAllocator()->MallocSingle();
0099 }
0100 
0101 inline void G4CerenkovQuasiTrackInfo::operator delete(void* aCerenkovATI)
0102 {
0103   aCerenkovATIAllocator()->FreeSingle((G4CerenkovQuasiTrackInfo*) aCerenkovATI);
0104 }
0105 
0106 #endif  // G4CerenkovQuasiTrackInfo_h