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/IonLet.hh
0027 /// \brief Definition of the RadioBio::IonLet class
0028 
0029 #ifndef RadiobiologyIonLet_HH
0030 #define RadiobiologyIonLet_HH
0031 
0032 #include "globals.hh"
0033 
0034 #include <valarray>
0035 
0036 namespace RadioBio
0037 {
0038 
0039 /// class to save and hold data for LET of different ions
0040 class IonLet
0041 {
0042   public:
0043     // Constructor wants ion data, trackID and total voxel number
0044     // trackID used only to see if particle is primary
0045     IonLet(G4int trackID, G4int PDG, G4String fullname, G4String name, G4int Z, G4int A,
0046            G4int voxNumber);
0047     ~IonLet() = default;
0048 
0049     // Alias for matrix type
0050     using array_type = std::valarray<G4double>;
0051 
0052     G4bool IsPrimary() const { return fIsPrimary; }
0053     G4int GetPDGencoding() const { return fPDGencoding; }
0054     G4String GetFullName() const { return fFullName; }
0055     G4String GetName() const { return fName; }
0056     G4int GetZ() const { return fZ; }
0057     G4int GetA() const { return fA; }
0058 
0059     // Track and Dose LET numerator and denominator
0060     array_type GetLETDN() const { return fLETDN; }
0061     array_type GetLETDD() const { return fLETDD; }
0062     array_type GetLETTN() const { return fLETTN; }
0063     array_type GetLETTD() const { return fLETTD; }
0064 
0065     // Final Dose and Track LET for the ion
0066     array_type GetLETD() const { return fLETD; }
0067     array_type GetLETT() const { return fLETT; }
0068 
0069     void SetLETDN(array_type LETDN) { fLETDN = LETDN; }
0070     void SetLETDD(array_type LETDD) { fLETDD = LETDD; }
0071     void SetLETTN(array_type LETTN) { fLETTN = LETTN; }
0072     void SetLETTD(array_type LETTD) { fLETTD = LETTD; }
0073 
0074     // To update data inside this IonLet
0075     void Update(G4int voxel, G4double DE, G4double DEELETrons, G4double Lsn, G4double DX);
0076 
0077     // To merge data from another IonLet object inside this one
0078     void Merge(const IonLet* lhs);
0079 
0080     // To calculate LET given the numerator and denominator
0081     void Calculate();
0082 
0083     // To sort by the mass number, else sort by the atomic one.
0084     G4bool operator<(const IonLet& a) const
0085     {
0086       return (this->fZ == a.fZ) ? this->fA < a.fA : this->fZ < a.fZ;
0087     }
0088 
0089   private:
0090     G4bool fIsPrimary = true;  // True if particle is primary
0091     G4int fPDGencoding = -1;  // Particle data group id for the particle
0092     G4String fFullName;  // AZ[excitation energy]: like He3[1277.4], ...
0093     G4String fName;  // simple name no excitation energy: He3, He4, ...
0094     G4int fZ = -1;  // atomic number
0095     G4int fA = -1;  // mass number
0096 
0097     // Track averaged LET and Dose averaged LET
0098     // Numerator, denominator, actual value.
0099     array_type fLETDN = {};
0100     array_type fLETDD = {};
0101     array_type fLETTN = {};
0102     array_type fLETTD = {};
0103     array_type fLETD = {};
0104     array_type fLETT = {};
0105 };
0106 
0107 }  // namespace RadioBio
0108 
0109 #endif  // IonLet_HH