Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:19

0001 #ifndef SimG4Core_CustomPhysics_G4ProcessHelper_H
0002 #define SimG4Core_CustomPhysics_G4ProcessHelper_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 class HistoHelper;
0023 class TProfile;
0024 class TH1D;
0025 
0026 class G4ProcessHelper {
0027 public:
0028   G4ProcessHelper(const edm::ParameterSet& p, CustomParticleFactory* ptr);
0029 
0030   ~G4ProcessHelper();
0031 
0032   G4bool ApplicabilityTester(const G4ParticleDefinition& aPart);
0033 
0034   G4double GetInclusiveCrossSection(const G4DynamicParticle* aParticle, const G4Element* anElement);
0035 
0036   //Make sure the element is known (for n/p-decision)
0037   ReactionProduct GetFinalState(const G4Track& aTrack, G4ParticleDefinition*& aTarget);
0038 
0039   G4ProcessHelper(const G4ProcessHelper&) = delete;
0040   G4ProcessHelper& operator=(const G4ProcessHelper&) = delete;
0041 
0042 private:
0043   G4double Regge(const double boost);
0044   G4double Pom(const double boost);
0045 
0046   G4double checkfraction;
0047   G4int n_22;
0048   G4int n_23;
0049 
0050   G4ParticleDefinition* theTarget;
0051   G4ParticleDefinition* theProton;
0052   G4ParticleDefinition* theNeutron;
0053   G4ParticleDefinition* theRmesoncloud;
0054   G4ParticleDefinition* theRbaryoncloud;
0055 
0056   ReactionMap* theReactionMap;
0057 
0058   G4double PhaseSpace(const ReactionProduct& aReaction, const G4DynamicParticle* aDynamicParticle);
0059 
0060   G4double ReactionProductMass(const ReactionProduct& aReaction, const G4DynamicParticle* aDynamicParticle);
0061 
0062   G4bool ReactionGivesBaryon(const ReactionProduct& aReaction);
0063 
0064   G4bool ReactionIsPossible(const ReactionProduct& aReaction, const G4DynamicParticle* aDynamicParticle);
0065 
0066   void ReadAndParse(const G4String& str, std::vector<G4String>& tokens, const G4String& delimiters = " ");
0067 
0068   //Map of applicable particles
0069   std::map<const G4ParticleDefinition*, G4bool> known_particles;
0070 
0071   //Map for physics parameters, name to value
0072   std::map<G4String, G4double> parameters;
0073 
0074   //The parameters themselves
0075   bool resonant;
0076   double ek_0;
0077   double gamma;
0078   double amplitude;
0079   double suppressionfactor;
0080   bool reggemodel;
0081   double hadronlifetime;
0082   double mixing;
0083 
0084   //Proton-scattering processes
0085   ReactionMap pReactionMap;
0086 
0087   //Neutron-scattering processes
0088   ReactionMap nReactionMap;
0089 
0090   CustomParticleFactory* fParticleFactory;
0091   G4ParticleTable* particleTable;
0092   HistoHelper* theHistoHelper;
0093   TProfile* h_xsec_lab;
0094   TProfile* h_xsec_cms;
0095   TH1D* h_sqrts;
0096   TProfile* h_q_p;
0097   TProfile* h_q_gamma;
0098 };
0099 #endif