Back to home page

EIC code displayed by LXR

 
 

    


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