Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-21 09:10:09

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 
0027 #ifndef G4DNASCAVENGERPROCESS_HH
0028 #define G4DNASCAVENGERPROCESS_HH
0029 
0030 #include "G4VITProcess.hh"
0031 #include "G4MoleculeTable.hh"
0032 
0033 class G4DNAMolecularReactionData;
0034 class G4MolecularConfiguration;
0035 class G4DNABoundingBox;
0036 class G4DNAScavengerMaterial;
0037 class G4DNAScavengerProcess : public G4VITProcess
0038 {
0039  public:
0040   using MolType = const G4MolecularConfiguration*;
0041   using Data    = const G4DNAMolecularReactionData;
0042   explicit G4DNAScavengerProcess(const G4String& aName,
0043                                  const G4DNABoundingBox& box,
0044                                  G4ProcessType type = fUserDefined);
0045   ~G4DNAScavengerProcess() override;
0046   G4DNAScavengerProcess(const G4DNAScavengerProcess&) = delete;
0047   G4DNAScavengerProcess& operator=(const G4DNAScavengerProcess&) = delete;
0048   void StartTracking(G4Track*) override;
0049   void SetReaction(MolType, Data* pData);
0050 
0051  public:
0052   void BuildPhysicsTable(const G4ParticleDefinition&) override;
0053 
0054   G4double PostStepGetPhysicalInteractionLength(
0055     const G4Track& track, G4double previousStepSize,
0056     G4ForceCondition* condition) override;
0057 
0058   G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override;
0059 
0060   G4double AtRestGetPhysicalInteractionLength(const G4Track&,
0061                                               G4ForceCondition*) override
0062   {
0063     return -1.0;
0064   }
0065 
0066   G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) override
0067   {
0068     return nullptr;
0069   }
0070 
0071   //  no operation in  AlongStepDoIt
0072   G4double AlongStepGetPhysicalInteractionLength(const G4Track&, G4double,
0073                                                  G4double, G4double&,
0074                                                  G4GPILSelection*) override
0075   {
0076     return -1.0;
0077   }
0078 
0079   //  no operation in  AlongStepDoIt
0080   G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&) override
0081   {
0082     return nullptr;
0083   }
0084 
0085  protected:
0086   struct G4DNAScavengerProcessState : public G4ProcessState
0087   {
0088     G4DNAScavengerProcessState();
0089     ~G4DNAScavengerProcessState() override { ; }
0090     G4double fPreviousTimeAtPreStepPoint;
0091     G4bool fIsInGoodMaterial;
0092   };
0093 
0094  protected:
0095   G4bool fIsInitialized;
0096   G4double fReturnedValue;
0097   G4ParticleChange fParticleChange;
0098   const G4MolecularConfiguration* fpMolecularConfiguration;
0099   std::map<MolType /*MolConf*/, std::map<MolType /*molConfMat*/, Data*>>
0100     fConfMap;
0101   std::vector<MolType> fpMaterialVector;
0102   MolType fpMaterialConf;
0103   const G4DNABoundingBox* fpBoundingBox;
0104   G4DNAScavengerMaterial* fpScavengerMaterial{nullptr};
0105   MolType fH3Op = G4MoleculeTable::Instance()->GetConfiguration("H3Op(B)");
0106   MolType fH2O = G4MoleculeTable::Instance()->GetConfiguration("H2O");
0107   MolType fHOm = G4MoleculeTable::Instance()->GetConfiguration("OHm(B)");
0108 };
0109 #endif  // FLASH1_G4DNASCAVENGERPROCESS_HH