Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4SpinDecayPhysics.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4SpinDecayPhysics.cc 71039 2015-04-09 09:23:55Z gum $
27 //
28 //---------------------------------------------------------------------------
29 //
30 // ClassName: G4SpinDecayPhysics
31 //
32 // Author: 2015 P. Gumplinger
33 //
34 // Modified:
35 //
36 //----------------------------------------------------------------------------
37 //
38 #include "G4SpinDecayPhysics.hh"
39 
40 #include "G4ParticleDefinition.hh"
41 #include "G4ProcessManager.hh"
42 
43 #include "G4ParticleTypes.hh"
44 #include "G4ParticleTable.hh"
45 
46 #include "G4ProcessTable.hh"
47 
48 #include "G4DecayTable.hh"
51 
52 // factory
54 //
56 
58  : G4VPhysicsConstructor("SpinDecay"), decayWithSpin(NULL), poldecay(NULL)
59 {
60 }
61 
63  : G4VPhysicsConstructor(name), decayWithSpin(NULL), poldecay(NULL)
64 {
65 }
66 
68 {
69  if (decayWithSpin) delete decayWithSpin;
70  if (poldecay) delete poldecay;
71 }
72 
74 {
78 
83 
86 
89 
91 
92  G4DecayTable* MuonPlusDecayTable = new G4DecayTable();
93  MuonPlusDecayTable -> Insert(new
94  G4MuonDecayChannelWithSpin("mu+",0.986));
95  MuonPlusDecayTable -> Insert(new
97  G4MuonPlus::MuonPlusDefinition() -> SetDecayTable(MuonPlusDecayTable);
98 
99  G4DecayTable* MuonMinusDecayTable = new G4DecayTable();
100  MuonMinusDecayTable -> Insert(new
101  G4MuonDecayChannelWithSpin("mu-",0.986));
102  MuonMinusDecayTable -> Insert(new
104  G4MuonMinus::MuonMinusDefinition() -> SetDecayTable(MuonMinusDecayTable);
105 }
106 
108 {
109  decayWithSpin = new G4DecayWithSpin();
110 
112 
113  G4VProcess* decay;
114  decay = processTable->FindProcess("Decay",G4MuonPlus::MuonPlus());
115 
116  G4ProcessManager* fManager;
117  fManager = G4MuonPlus::MuonPlus()->GetProcessManager();
118 
119  if (fManager) {
120  if (decay) fManager->RemoveProcess(decay);
121  fManager->AddProcess(decayWithSpin);
122  // set ordering for PostStepDoIt and AtRestDoIt
123  fManager ->SetProcessOrdering(decayWithSpin, idxPostStep);
124  fManager ->SetProcessOrdering(decayWithSpin, idxAtRest);
125  }
126 
128 
129  if (fManager) {
130  if (decay) fManager->RemoveProcess(decay);
131  fManager->AddProcess(decayWithSpin);
132  // set ordering for PostStepDoIt and AtRestDoIt
133  fManager ->SetProcessOrdering(decayWithSpin, idxPostStep);
134  fManager ->SetProcessOrdering(decayWithSpin, idxAtRest);
135  }
136 
137  poldecay = new G4PionDecayMakeSpin();
138 
139  decay = processTable->FindProcess("Decay",G4PionPlus::PionPlus());
140 
141  fManager = G4PionPlus::PionPlus()->GetProcessManager();
142 
143  if (fManager) {
144  if (decay) fManager->RemoveProcess(decay);
145  fManager->AddProcess(poldecay);
146  // set ordering for PostStepDoIt and AtRestDoIt
147  fManager ->SetProcessOrdering(poldecay, idxPostStep);
148  fManager ->SetProcessOrdering(poldecay, idxAtRest);
149  }
150 
151  decay = processTable->FindProcess("Decay",G4PionMinus::PionMinus());
152 
154 
155  if (fManager) {
156  if (decay) fManager->RemoveProcess(decay);
157  fManager->AddProcess(poldecay);
158  // set ordering for PostStepDoIt and AtRestDoIt
159  fManager ->SetProcessOrdering(poldecay, idxPostStep);
160  fManager ->SetProcessOrdering(poldecay, idxAtRest);
161  }
162 }
virtual void ConstructProcess()
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
const XML_Char * name
Definition: expat.h:151
static G4GenericIon * GenericIonDefinition()
Definition: G4GenericIon.cc:88
static G4MuonPlus * MuonPlus()
Definition: G4MuonPlus.cc:99
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
virtual void ConstructParticle()
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
void Insert(const PVNodeID *pvPath, size_t pathLength, G4int index, Node *node)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
G4ProcessManager * GetProcessManager() const
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
static G4MuonMinus * MuonMinus()
Definition: G4MuonMinus.cc:100
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
G4VProcess * RemoveProcess(G4VProcess *aProcess)
static G4ProcessTable * GetProcessTable()
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81