SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
LCSUSYPhysics.cc
Go to the documentation of this file.
1 #include "LCSUSYPhysics.hh"
2 
3 // SLIC
4 #include "HepPDTManager.hh"
5 #include "LCSUSYDecay.hh"
6 
7 // Geant4
8 #include "G4Version.hh"
9 #include "G4ProcessManager.hh"
10 #include "G4ParticleDefinition.hh"
11 #include "G4UnknownDecay.hh"
12 #include "G4SystemOfUnits.hh"
13 
14 namespace slic {
16  G4VPhysicsConstructor(name) {
17 }
18 
20 }
21 
22 #ifndef aParticleIterator
23 #define aParticleIterator ((subInstanceManager.offset[g4vpcInstanceID])._aParticleIterator)
24 #endif
25 
27 
28  // Get the particle data table to be imported.
29  HepPDT::ParticleDataTable* pdtbl = HepPDTManager::instance()->getParticleDataTable();
30 
31  // Loop over all particles.
32  for (HepPDT::ParticleDataTable::const_iterator it = pdtbl->begin(); it != pdtbl->end(); it++) {
33  HepPDT::ParticleID id = it->first;
34  HepPDT::ParticleData pdata = it->second;
35 
36  // Only adding SUSY particles.
37  if (id.isSUSY()) {
38  // Create a G4ParticleDefinition for this SUSY particle.
39  new G4ParticleDefinition(pdata.PDTname(), // name
40  pdata.mass().value() * GeV, // mass
41  pdata.totalWidth().value(), // width
42  pdata.charge(), // charge
43  0, // 2*spin
44  0, // parity
45  0, // C-conjugation
46  0, // 2*isospin
47  0, // 2*isospin3
48  0, // G-parity
49  "susy", // type
50  0, // lepton number
51  0, // baryon number
52  pdata.pid(), // PDG encoding
53  false, // stable
54  1e30, // lifetime (DEBUG)
55  0, // decay table
56  false // short lived
57  );
58  }
59  }
60 }
61 
63  aParticleIterator->reset();
64  while ((*aParticleIterator)()) {
65  G4ParticleDefinition* pdef = aParticleIterator->value();
66  G4ProcessManager* pmgr = pdef->GetProcessManager();
67  if (m_decay.IsApplicable(*pdef)) {
68  if (pdef->GetPDGCharge() != 0) {
69  pmgr->AddProcess(&m_scatter, -1, 1, 1); // multiple scattering
70  pmgr->AddProcess(&m_ionise, -1, 2, 2); // ionisation
71  pmgr->AddProcess(&m_decay, -1, -1, 3); // decay
72  } else {
73  pmgr->AddProcess(&m_scatter, -1, 1, 1); // multiple scattering
74  pmgr->AddProcess(&m_decay, -1, -1, 2); // decay
75  }
76  }
77  }
78 }
79 }
#define aParticleIterator
static HepPDTManager * instance()
G4bool IsApplicable(const G4ParticleDefinition &pdef)
Definition: LCSUSYDecay.hh:27
virtual ~LCSUSYPhysics()
G4hIonisation m_ionise
G4hMultipleScattering m_scatter
LCSUSYPhysics(const G4String &name="LCSUSYPhysics")
@ name
Definition: LogStream.hh:26