ATLAS Offline Software
Loading...
Searching...
No Matches
G4SMuonLPlus.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "G4SMuonLPlus.hh"
6// ######################################################################
7// ### SMuonLPlus ###
8// ######################################################################
9
10G4SMuonLPlus* G4SMuonLPlus::theInstance = NULL;
11
12G4SMuonLPlus* G4SMuonLPlus::Definition(G4double mass, G4double width, G4double charge, G4double PDG, G4bool stable, G4double lifetime, G4bool shortlived)
13{
14
15 if (theInstance !=0 && (mass>=0. || width>=0. || lifetime>=0.) )
16 {
17 G4ExceptionDescription description;
18 description << "Trying to redefine the G4SMuonL Plus properties after it has been constructed is not allowed";
19 G4Exception("G4SMuonLPlus", "FailedRedefinition", FatalException, description);
20 abort();
21 }
22
23 if (theInstance != 0)
24 {
25 return theInstance;
26 }
27
28
29 // Arguments for constructor are as follows
30 // name mass width charge
31 // 2*spin parity C-conjugation
32 // 2*Isospin 2*Isospin3 G-parity
33 // type lepton number baryon number PDG encoding
34 // stable lifetime decay table
35 // shortlived subType anti_encoding
36 if (mass >= 0) {
37
38 G4ParticleDefinition* anInstance =
39 new G4ParticleDefinition("s_mu_plus_L", mass, width, charge,
40 0, 0, 0,
41 0, 0, 0,
42 "slepton", 1, 0, PDG,
43 stable, lifetime, NULL,
44 shortlived, "SMuonLPlus");
45
46 theInstance = reinterpret_cast<G4SMuonLPlus*>(anInstance);
47 return theInstance;
48
49 }
50 else
51 {
52 G4ExceptionDescription description;
53 description << "Trying to create a particle with default constructor is not allowed";
54 G4Exception("G4SMuonLPlus", "DefaultConstructorCalled", FatalException, description);
55 abort();
56 }
57}
double charge(const T &p)
Definition AtlasPID.h:997
const double width
struct PDG20 PDG
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:91