Back to home page

EIC code displayed by LXR

 
 

    


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

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 scavenger/include/ParserChemReaction.hh
0027 /// \brief Definition of the scavenger::ParserChemReaction class
0028 
0029 #ifndef SCAVENGER_ParserChemReaction_h
0030 #define SCAVENGER_ParserChemReaction_h 1
0031 
0032 #include "globals.hh"
0033 
0034 #include <array>
0035 #include <vector>
0036 
0037 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0038 namespace scavenger
0039 {
0040 
0041 /// Parser to read user files defining chemical reactions and
0042 /// scavengers (reaction with background)
0043 
0044 class ParserChemReaction
0045 {
0046   public:
0047     ParserChemReaction() = default;
0048 
0049     ~ParserChemReaction() = default;
0050 
0051     void ReadReactionFile(const G4String& fileName);
0052 
0053     inline auto GetListReactant1() { return fListReactant1; }
0054 
0055     inline auto GetListReactant2() { return fListReactant2; }
0056 
0057     inline auto GetListProduct() { return fListProduct; }
0058 
0059     inline auto GetListRate() { return fListRate; }
0060 
0061   private:
0062     void AddReaction(const G4String& reactionString, const G4String& type);
0063 
0064     void ReadReservoir(const G4String& reservoirString);
0065 
0066     G4double GetScavengerConcentration(const G4String& name);
0067 
0068     static void ReadReaction(const G4String& reactionString, std::vector<G4String>& reactant,
0069                              std::vector<G4String>& product, G4double& reactionRate);
0070 
0071     void ImplementReaction(const G4String& reactant1, const G4String& reactant2,
0072                            const std::vector<G4String>& product, const G4double& reactionRate,
0073                            const G4String& type);
0074 
0075     static void ReplaceString(G4String& aString, const G4String& from, const G4String& to);
0076 
0077     std::array<std::vector<G4String>, 5> fListReactant1;
0078     std::array<std::vector<G4String>, 5> fListReactant2;
0079     std::array<std::vector<std::vector<G4String>>, 5> fListProduct;
0080     std::array<std::vector<G4double>, 5> fListRate;
0081     std::map<G4String, G4double> fReservoirConcentrationMap;
0082 };
0083 
0084 }  // namespace scavenger
0085 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0086 
0087 #endif