Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // >> 23 // >> 24 // $Id: G4KaonZeroShort.cc,v 1.13 2003/06/16 16:57:46 gunter Exp $ >> 25 // GEANT4 tag $Name: geant4-05-02-patch-01 $ >> 26 // >> 27 // 26 // ------------------------------------------- 28 // ---------------------------------------------------------------------- 27 // GEANT 4 class implementation file 29 // GEANT 4 class implementation file 28 // 30 // 29 // History: first implementation, based o 31 // History: first implementation, based on object model of 30 // 4th April 1996, G.Cosmo 32 // 4th April 1996, G.Cosmo 31 // H.Kurashige 33 // H.Kurashige 7 Jul 96 32 // ******************************************* 34 // ********************************************************************** 33 // New impelemenataion as an utility class M << 35 34 // ------------------------------------------- << 36 #include <fstream> >> 37 #include <iomanip> 35 38 36 #include "G4KaonZeroShort.hh" 39 #include "G4KaonZeroShort.hh" 37 40 38 #include "G4DecayTable.hh" << 39 #include "G4ParticleTable.hh" << 40 #include "G4PhaseSpaceDecayChannel.hh" 41 #include "G4PhaseSpaceDecayChannel.hh" 41 #include "G4String.hh" << 42 #include "G4DecayTable.hh" 42 #include "G4SystemOfUnits.hh" << 43 #include "G4Types.hh" << 44 #include "G4VDecayChannel.hh" << 45 << 46 G4KaonZeroShort* G4KaonZeroShort::theInstance << 47 43 48 G4KaonZeroShort* G4KaonZeroShort::Definition() << 44 // ###################################################################### >> 45 // ### KAONZEROSHORT ### >> 46 // ###################################################################### >> 47 >> 48 G4KaonZeroShort::G4KaonZeroShort( >> 49 const G4String& aName, G4double mass, >> 50 G4double width, G4double charge, >> 51 G4int iSpin, G4int iParity, >> 52 G4int iConjugation, G4int iIsospin, >> 53 G4int iIsospin3, G4int gParity, >> 54 const G4String& pType, G4int lepton, >> 55 G4int baryon, G4int encoding, >> 56 G4bool stable, G4double lifetime, >> 57 G4DecayTable *decaytable ) >> 58 : G4VMeson( aName,mass,width,charge,iSpin,iParity, >> 59 iConjugation,iIsospin,iIsospin3,gParity,pType, >> 60 lepton,baryon,encoding,stable,lifetime,decaytable ) 49 { 61 { 50 if (theInstance != nullptr) return theInstan << 62 SetParticleSubType("kaon"); 51 const G4String name = "kaon0S"; << 63 // Anti-particle of K0Short is K0Short itself 52 // search in particle table] << 64 SetAntiPDGEncoding(encoding); 53 G4ParticleTable* pTable = G4ParticleTable::G << 65 54 G4ParticleDefinition* anInstance = pTable->F << 66 //create Decay Table 55 if (anInstance == nullptr) { << 67 G4DecayTable* table = GetDecayTable(); 56 // create particle << 68 if (table!=NULL) delete table; 57 // << 69 table = new G4DecayTable(); 58 // Arguments for constructor are as fol << 70 59 // name mass << 71 // create decay channels 60 // 2*spin parity C- << 72 G4VDecayChannel** mode = new G4VDecayChannel*[2]; 61 // 2*Isospin 2*Isospin3 << 73 // kaon0s -> pi+ + pi- 62 // type lepton number ba << 74 mode[0] = new G4PhaseSpaceDecayChannel("kaon0S",0.686,2,"pi+","pi-"); 63 // stable lifetime << 75 // kaon0s -> pi0 + pi0 64 // shortlived subType << 76 mode[1] = new G4PhaseSpaceDecayChannel("kaon0S",0.313,2,"pi0","pi0"); 65 << 66 // clang-format off << 67 anInstance = new G4ParticleDefinition( << 68 name, 0.497614*GeV, 7.350 << 69 0, -1, << 70 1, 0, << 71 "meson", 0, << 72 false, 0.08954*ns, << 73 false, "kaon", << 74 // clang-format on << 75 << 76 // create Decay Table << 77 auto table = new G4DecayTable(); << 78 << 79 // create decay channels << 80 auto mode = new G4VDecayChannel*[2]; << 81 // kaon0s -> pi+ + pi- << 82 mode[0] = new G4PhaseSpaceDecayChannel("ka << 83 // kaon0s -> pi0 + pi0 << 84 mode[1] = new G4PhaseSpaceDecayChannel("ka << 85 << 86 for (G4int index = 0; index < 2; index++) << 87 table->Insert(mode[index]); << 88 delete[] mode; << 89 << 90 anInstance->SetDecayTable(table); << 91 } << 92 theInstance = static_cast<G4KaonZeroShort*>( << 93 return theInstance; << 94 } << 95 77 96 G4KaonZeroShort* G4KaonZeroShort::KaonZeroShor << 78 for (G4int index=0; index <2; index++ ) table->Insert(mode[index]); 97 { << 79 delete [] mode; 98 return Definition(); << 99 } << 100 80 101 G4KaonZeroShort* G4KaonZeroShort::KaonZeroShor << 81 SetDecayTable(table); 102 { << 103 return Definition(); << 104 } 82 } >> 83 >> 84 // ...................................................................... >> 85 // ... static member definitions ... >> 86 // ...................................................................... >> 87 // >> 88 // Arguments for constructor are as follows >> 89 // name mass width charge >> 90 // 2*spin parity C-conjugation >> 91 // 2*Isospin 2*Isospin3 G-parity >> 92 // type lepton number baryon number PDG encoding >> 93 // stable lifetime decay table >> 94 >> 95 G4KaonZeroShort G4KaonZeroShort::theKaonZeroShort( >> 96 "kaon0S", 0.497672*GeV, 7.373e-12*MeV, 0.0, >> 97 0, -1, 0, >> 98 1, 0, 0, >> 99 "meson", 0, 0, 310, >> 100 false, 0.08926*ns, NULL >> 101 ); >> 102 >> 103 G4KaonZeroShort* G4KaonZeroShort::KaonZeroShortDefinition(){return &theKaonZeroShort;} >> 104 >> 105 G4KaonZeroShort* G4KaonZeroShort::KaonZeroShort(){return &theKaonZeroShort;} >> 106 105 107