Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:19

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 radiobiology/include/LET.hh
0027 /// \brief Definition of the RadioBio::LET class
0028 
0029 #ifndef RadiobiologyLET_h
0030 #define RadiobiologyLET_h 1
0031 #include "G4AnalysisManager.hh"
0032 #include "G4ParticleDefinition.hh"
0033 #include "globals.hh"
0034 
0035 #include "VRadiobiologicalQuantity.hh"
0036 
0037 #include <fstream>
0038 #include <string>
0039 #include <valarray>
0040 #include <vector>
0041 
0042 class G4Material;
0043 
0044 namespace RadioBio
0045 {
0046 
0047 // Forward declariation of other radiobiology classes
0048 class Hit;
0049 class LETAccumulable;
0050 class LETMessenger;
0051 class IonLet;
0052 
0053 class LET : public VRadiobiologicalQuantity
0054 {
0055   public:
0056     LET();
0057     ~LET() override;
0058 
0059     // Virtual methods to override
0060     void AddFromAccumulable(G4VAccumulable*) override;
0061     void Initialize() override;
0062     void Compute() override;
0063     void Reset() override;
0064     void Store() override;
0065     void PrintParameters() override;
0066 
0067   private:
0068     // Numerator and Denominator of Track-averaged LET
0069     array_type fNTotalLETT = {};
0070     array_type fDTotalLETT = {};
0071 
0072     // Numerator and Denominator of Dose-averaged LET
0073     array_type fNTotalLETD = {};
0074     array_type fDTotalLETD = {};
0075 
0076     // Track-averaged and Dose-averaged LET
0077     array_type fTotalLETT = {};
0078     array_type fTotalLETD = {};
0079 
0080     std::vector<IonLet> fIonLetStore;
0081 
0082     // std::ofstream ofs;
0083 
0084     // To be used for accumulation
0085     void SetNTotalLETT(const array_type NTotalLETT) { fNTotalLETT = NTotalLETT; }
0086     void SetNTotalLETD(const array_type NTotalLETD) { fNTotalLETD = NTotalLETD; }
0087     void SetDTotalLETT(const array_type DTotalLETT) { fDTotalLETT = DTotalLETT; }
0088     void SetDTotalLETD(const array_type DTotalLETD) { fDTotalLETD = DTotalLETD; }
0089 
0090     void AddNTotalLETT(const array_type NTotalLETT) { fNTotalLETT += NTotalLETT; }
0091     void AddNTotalLETD(const array_type NTotalLETD) { fNTotalLETD += NTotalLETD; }
0092     void AddDTotalLETT(const array_type DTotalLETT) { fDTotalLETT += DTotalLETT; }
0093     void AddDTotalLETD(const array_type DTotalLETD) { fDTotalLETD += DTotalLETD; }
0094 
0095     // To use to add an ion to the store (or merge data)
0096     void AddIon(const IonLet ion);
0097 };
0098 
0099 }  // namespace RadioBio
0100 
0101 #endif  // LET_h