Loading...
Searching...
No Matches
Public Member Functions | List of all members
Par01PiModel Class Reference

#include <Doxymodules_parameterisations.h>

Inheritance diagram for Par01PiModel:
G4VFastSimulationModel

Public Member Functions

 Par01PiModel (G4Region *anEnvelope)
 
 ~Par01PiModel ()
 
virtual G4bool IsApplicable (const G4ParticleDefinition &)
 
virtual G4bool ModelTrigger (const G4FastTrack &)
 
virtual void DoIt (const G4FastTrack &, G4FastStep &)
 

Detailed Description

Definition at line 24 of file Doxymodules_parameterisations.h.

Constructor & Destructor Documentation

◆ Par01PiModel()

Par01PiModel::Par01PiModel ( G4Region anEnvelope)

Definition at line 39 of file Par01PiModel.cc.

39 :
40 G4VFastSimulationModel("Par01PiModel",anEnvelope)
41{;}

◆ ~Par01PiModel()

Par01PiModel::~Par01PiModel ( )

Definition at line 45 of file Par01PiModel.cc.

46{;}

Member Function Documentation

◆ IsApplicable()

G4bool Par01PiModel::IsApplicable ( const G4ParticleDefinition particleType)
virtual

Definition at line 50 of file Par01PiModel.cc.

51{
52 return
53 &particleType == G4PionMinus::PionMinusDefinition() ||
54 &particleType == G4PionPlus::PionPlusDefinition();
55}

◆ ModelTrigger()

G4bool Par01PiModel::ModelTrigger ( const G4FastTrack fastTrack)
virtual

Definition at line 59 of file Par01PiModel.cc.

59 {
60 //-------------------------------------------------------------
61 // UserTrigger() method: method which has to decide if
62 // the parameterisation has to be applied.
63 // Here ModelTrigger() asks the user (ie you) a 0/1 answer.
64 //
65 // Note that quantities like the local/global position/direction etc..
66 // are available at this level via the fastTrack parameter (allowing
67 // to check distance from boundaries, see below to allow the decision)
68 //--------------------------------------------------------------
69 G4cout << "\nPar01PiModel::ModelTrigger() called:" << G4endl;
70 G4cout << "--------------------------------" << G4endl;
71 G4cout << "(particle is a " << fastTrack.GetPrimaryTrack()->
72 GetDefinition()->GetParticleName() << " )\n" << G4endl;
73
74 // -- Examples of available informations:
75
76 // -- position:
77 G4cout << " Track position: " <<
78 fastTrack.GetPrimaryTrack()->GetPosition() << "(global coord.)" <<
79 fastTrack.GetPrimaryTrackLocalPosition() << "(in envelope coord.)"
80 << G4endl;
81
82 // -- direction:
83 G4cout << " Track direction:" <<
84 fastTrack.GetPrimaryTrack()->GetMomentum().unit() <<
85 "(global coord.)" <<
86 fastTrack.GetPrimaryTrackLocalDirection() << "(in envelope coord.)" <<
87 G4endl;
88
89 return true;
90}

◆ DoIt()

void Par01PiModel::DoIt ( const G4FastTrack fastTrack,
G4FastStep fastStep 
)
virtual

Definition at line 94 of file Par01PiModel.cc.

101{
102
103 //------------------------------------------------
104 // The primary track continues along its direction.
105 // One secondary (a photon) is added:
106 //------------------------------------------------
107 G4cout << " Pion `model' applied\n" << G4endl;
108
109 //------------------------------
110 // Primary:
111 // idem as in "DefaultModel":
112 //
113 //------------------------------
114 G4ThreeVector position;
115 G4double distance;
116 distance = fastTrack.GetEnvelopeSolid()->
117 DistanceToOut(fastTrack.GetPrimaryTrackLocalPosition(),
118 fastTrack.GetPrimaryTrackLocalDirection());
119 position = fastTrack.GetPrimaryTrackLocalPosition() +
120 distance*fastTrack.GetPrimaryTrackLocalDirection();
121
122 // -- set final position:
123 fastStep.ProposePrimaryTrackFinalPosition(position);
124
125 //---------------------------
126 // Secondary:
127 // Adds one "secondary":
128 //---------------------------
129 // -- First, user has to say how many secondaries will be created:
130 fastStep.SetNumberOfSecondaryTracks(1);
131
132 //------------------------
133 // -- Build the secondary:
134 //------------------------
135 // -- direction:
136 G4ParticleMomentum direction(fastTrack.GetPrimaryTrackLocalDirection());
137 direction.setZ(direction.z()*0.5);
138 direction.setY(direction.y()+direction.z()*0.1);
139 direction = direction.unit(); // necessary ?
140
141 // -- dynamics (Note that many constructors exists for G4DynamicParticle
142 // -- see prototype/particle+matter/particles/management/include/G4DynamicParticle.hh)
143 G4DynamicParticle dynamique(G4Gamma::GammaDefinition(),
144 direction,
145 fastTrack.GetPrimaryTrack()->
146 GetKineticEnergy()/2.);
147 // -- position:
148 G4double Dist;
149 Dist = fastTrack.GetEnvelopeSolid()->
150 DistanceToOut(fastTrack.GetPrimaryTrackLocalPosition(),
151 direction);
152 G4ThreeVector posi;
153 posi = fastTrack.GetPrimaryTrackLocalPosition() + Dist*direction;
154
155 //------------------------------------
156 //-- Creation of the secondary Track:
157 //------------------------------------
158 fastStep.CreateSecondaryTrack(dynamique, posi,
159 fastTrack.GetPrimaryTrack()->GetGlobalTime());
160}

The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration