Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Par01PiModel Class Reference

#include <Par01PiModel.hh>

Inheritance diagram for Par01PiModel:
Collaboration diagram for Par01PiModel:

Public Member Functions

 Par01PiModel (G4Region *anEnvelope)
 
 ~Par01PiModel ()
 
virtual G4bool IsApplicable (const G4ParticleDefinition &)
 
virtual G4bool ModelTrigger (const G4FastTrack &)
 
virtual void DoIt (const G4FastTrack &, G4FastStep &)
 
- Public Member Functions inherited from G4VFastSimulationModel
 G4VFastSimulationModel (const G4String &aName)
 
 G4VFastSimulationModel (const G4String &aName, G4Envelope *, G4bool IsUnique=FALSE)
 
virtual ~G4VFastSimulationModel ()
 
virtual G4bool AtRestModelTrigger (const G4FastTrack &)
 
virtual void AtRestDoIt (const G4FastTrack &, G4FastStep &)
 
const G4String GetName () const
 
G4bool operator== (const G4VFastSimulationModel &) const
 

Detailed Description

Definition at line 41 of file Par01PiModel.hh.

Constructor & Destructor Documentation

Par01PiModel::Par01PiModel ( G4Region anEnvelope)

Definition at line 40 of file Par01PiModel.cc.

40  :
41  G4VFastSimulationModel("Par01PiModel",anEnvelope)
42 {;}
G4VFastSimulationModel(const G4String &aName)
Par01PiModel::~Par01PiModel ( )

Definition at line 46 of file Par01PiModel.cc.

47 {;}

Member Function Documentation

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

Implements G4VFastSimulationModel.

Definition at line 95 of file Par01PiModel.cc.

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

Here is the call graph for this function:

G4bool Par01PiModel::IsApplicable ( const G4ParticleDefinition particleType)
virtual

Implements G4VFastSimulationModel.

Definition at line 51 of file Par01PiModel.cc.

52 {
53  return
54  &particleType == G4PionMinus::PionMinusDefinition() ||
55  &particleType == G4PionPlus::PionPlusDefinition();
56 }
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93

Here is the call graph for this function:

G4bool Par01PiModel::ModelTrigger ( const G4FastTrack fastTrack)
virtual

Implements G4VFastSimulationModel.

Definition at line 60 of file Par01PiModel.cc.

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

Here is the call graph for this function:


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