Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-07-09 05:00:33

0001 #ifndef SimG4Core_CustomPhysics_CustomProcessHelper_H
0002 #define SimG4Core_CustomPhysics_CustomProcessHelper_H
0003 
0004 #include "globals.hh"
0005 #include "G4ParticleDefinition.hh"
0006 #include "G4DynamicParticle.hh"
0007 #include "G4Element.hh"
0008 #include "G4Track.hh"
0009 
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 
0012 #include <vector>
0013 #include <map>
0014 
0015 //Typedefs just made to make life easier :-)
0016 typedef std::vector<G4int> ReactionProduct;
0017 typedef std::vector<ReactionProduct> ReactionProductList;
0018 typedef std::map<G4int, ReactionProductList> ReactionMap;
0019 
0020 class G4ParticleTable;
0021 class CustomParticleFactory;
0022 
0023 class CustomProcessHelper {
0024 public:
0025   CustomProcessHelper(const edm::ParameterSet& p, CustomParticleFactory* ptr);
0026 
0027   ~CustomProcessHelper() = default;
0028 
0029   G4bool ApplicabilityTester(const G4ParticleDefinition& aPart);
0030 
0031   G4double GetInclusiveCrossSection(const G4DynamicParticle* aParticle, const G4Element* anElement);
0032 
0033   //Make sure the element is known (for n/p-decision)
0034   ReactionProduct GetFinalState(const G4Track& aTrack, G4ParticleDefinition*& aTarget);
0035 
0036   CustomProcessHelper(const CustomProcessHelper&) = delete;
0037   CustomProcessHelper& operator=(const CustomProcessHelper&) = delete;
0038 
0039 private:
0040   G4double Regge(const double boost);
0041   G4double Pom(const double boost);
0042 
0043   G4double checkfraction;
0044   G4int n_22;
0045   G4int n_23;
0046 
0047   G4ParticleDefinition* theTarget;
0048   G4ParticleDefinition* theProton;
0049   G4ParticleDefinition* theNeutron;
0050   G4ParticleDefinition* theRmesoncloud;
0051   G4ParticleDefinition* theRbaryoncloud;
0052 
0053   ReactionMap* theReactionMap;
0054 
0055   G4double PhaseSpace(const ReactionProduct& aReaction, const G4DynamicParticle* aDynamicParticle);
0056 
0057   G4double ReactionProductMass(const ReactionProduct& aReaction, const G4DynamicParticle* aDynamicParticle);
0058 
0059   G4bool ReactionGivesBaryon(const ReactionProduct& aReaction);
0060 
0061   G4bool ReactionIsPossible(const ReactionProduct& aReaction, const G4DynamicParticle* aDynamicParticle);
0062 
0063   void ReadAndParse(const G4String& str, std::vector<G4String>& tokens, const G4String& delimiters = " ");
0064 
0065   //Map of applicable particles
0066   std::map<const G4ParticleDefinition*, G4bool> known_particles;
0067 
0068   //Map for physics parameters, name to value
0069   std::map<G4String, G4double> parameters;
0070 
0071   //The parameters themselves
0072   bool resonant;
0073   double ek_0;
0074   double gamma;
0075   double amplitude;
0076   double suppressionfactor;
0077   bool reggemodel;
0078   double hadronlifetime;
0079   double mixing;
0080 
0081   //Proton-scattering processes
0082   ReactionMap pReactionMap;
0083 
0084   //Neutron-scattering processes
0085   ReactionMap nReactionMap;
0086 
0087   CustomParticleFactory* fParticleFactory;
0088   G4ParticleTable* particleTable;
0089 };
0090 
0091 #endif