LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
MuNuclearSplittingProcessXSecBias.h
Go to the documentation of this file.
1 
8 #ifndef LARG4_MNXS_H
9 #define LARG4_MNXS_H
10 
11 #include "Geant4/G4ForceCondition.hh"
12 #include "Geant4/G4GPILSelection.hh"
13 #include "Geant4/G4Types.hh"
14 #include "Geant4/G4VParticleChange.hh"
15 #include "Geant4/G4VProcess.hh"
16 #include "Geant4/G4WrapperProcess.hh"
17 #include "Geant4/Randomize.hh"
18 #include <cmath>
19 class G4Step;
20 class G4Track;
21 
22 namespace larg4 {
23 
24  class MuNuclearSplittingProcessXSecBias : public G4WrapperProcess {
25  // Override PostStepDoIt method
26  public:
29 
30  void SetNSplit(G4int nTrx, G4int xB = 0, G4double xFac = 1)
31  {
32  fNSplit = nTrx, eFactor = (G4double)xFac, xBiasMode = xB;
33  };
34  void SetIsActive(G4bool doIt) { fActive = doIt; };
35 
36  G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& step);
37  G4VParticleChange* AlongStepDoIt(const G4Track& track, const G4Step& step);
39  // GPIL //////////////
41  virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track& track,
42  G4double previousStepSize,
43  G4double currentMinimumStep,
44  G4double& proposedSafety,
45  G4GPILSelection* selection);
46  virtual G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
47  G4double previousStepSize,
48  G4ForceCondition* condition);
49 
50  protected:
52  {
53  G4VProcess::theNumberOfInteractionLengthLeft = -std::log(G4UniformRand());
54  theInitialNumberOfInteractionLength = G4VProcess::theNumberOfInteractionLengthLeft;
55  }
56 
57  private:
58  // Data members
59  G4int fNSplit;
60  G4bool fActive;
61  G4int xBiasMode;
62  G4double eFactor; // enhancement factor to the cross-setion
63 
64  G4VParticleChange fParticleChange;
65  // weight change applied at AlongStepDoIt()
66  G4double wc;
68 
69  G4double XBiasSurvivalProbability();
70  G4double XBiasSecondaryWeight();
72  };
73 
74 } // end namespace
75 
76 #endif // MNSP
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
void SetNSplit(G4int nTrx, G4int xB=0, G4double xFac=1)
Geant4 interface.
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &step)
Float_t track
Definition: plot.C:35
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &step)