Geant4 Cross Reference |
>> 1 // This code implementation is the intellectual property of >> 2 // the GEANT4 collaboration. 1 // 3 // 2 // ******************************************* << 4 // By copying, distributing or modifying the Program (or any work 3 // * License and Disclaimer << 5 // based on the Program) you indicate your acceptance of this statement, 4 // * << 6 // and all its terms. 5 // * The Geant4 software is copyright of th << 6 // * the Geant4 Collaboration. It is provided << 7 // * conditions of the Geant4 Software License << 8 // * LICENSE and available at http://cern.ch/ << 9 // * include a list of copyright holders. << 10 // * << 11 // * Neither the authors of this software syst << 12 // * institutes,nor the agencies providing fin << 13 // * work make any representation or warran << 14 // * regarding this software system or assum << 15 // * use. Please see the license in the file << 16 // * for the full disclaimer and the limitatio << 17 // * << 18 // * This code implementation is the result << 19 // * technical work of the GEANT4 collaboratio << 20 // * By using, copying, modifying or distri << 21 // * any work based on the software) you ag << 22 // * use in resulting scientific publicati << 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* << 25 // 7 // >> 8 // $Id: G4AntiKaonZero.cc,v 1.3 2000/02/27 05:57:41 kurasige Exp $ >> 9 // GEANT4 tag $Name: geant4-03-01 $ >> 10 // >> 11 // 26 // ------------------------------------------- 12 // ---------------------------------------------------------------------- 27 // GEANT 4 class implementation file 13 // GEANT 4 class implementation file 28 // 14 // >> 15 // For information related to this code contact: >> 16 // CERN, CN Division, ASD Group 29 // History: first implementation, based o 17 // History: first implementation, based on object model of 30 // 4th April 1996, G.Cosmo 18 // 4th April 1996, G.Cosmo 31 // H.Kurashige 19 // H.Kurashige 7 Jul 96 32 // ******************************************* 20 // ********************************************************************** 33 // New impelemenataion as an utility class M << 21 34 // ------------------------------------------- << 22 #include "g4std/fstream" >> 23 #include "g4std/iomanip" 35 24 36 #include "G4AntiKaonZero.hh" 25 #include "G4AntiKaonZero.hh" 37 26 38 #include "G4DecayTable.hh" << 39 #include "G4ParticleTable.hh" << 40 #include "G4PhaseSpaceDecayChannel.hh" 27 #include "G4PhaseSpaceDecayChannel.hh" 41 #include "G4String.hh" << 28 #include "G4DecayTable.hh" 42 #include "G4SystemOfUnits.hh" << 43 #include "G4Types.hh" << 44 #include "G4VDecayChannel.hh" << 45 << 46 G4AntiKaonZero* G4AntiKaonZero::theInstance = << 47 29 48 G4AntiKaonZero* G4AntiKaonZero::Definition() << 30 // ###################################################################### >> 31 // ### ANTIKAONZERO ### >> 32 // ###################################################################### >> 33 >> 34 G4AntiKaonZero::G4AntiKaonZero( >> 35 const G4String& aName, G4double mass, >> 36 G4double width, G4double charge, >> 37 G4int iSpin, G4int iParity, >> 38 G4int iConjugation, G4int iIsospin, >> 39 G4int iIsospin3, G4int gParity, >> 40 const G4String& pType, G4int lepton, >> 41 G4int baryon, G4int encoding, >> 42 G4bool stable, G4double lifetime, >> 43 G4DecayTable *decaytable ) >> 44 : G4VMeson( aName,mass,width,charge,iSpin,iParity, >> 45 iConjugation,iIsospin,iIsospin3,gParity,pType, >> 46 lepton,baryon,encoding,stable,lifetime,decaytable ) 49 { 47 { 50 if (theInstance != nullptr) return theInstan << 48 SetParticleSubType("kaon"); 51 const G4String name = "anti_kaon0"; << 49 //create Decay Table 52 // search in particle table] << 50 G4DecayTable* table = GetDecayTable(); 53 G4ParticleTable* pTable = G4ParticleTable::G << 51 if (table!=NULL) delete table; 54 G4ParticleDefinition* anInstance = pTable->F << 52 table = new G4DecayTable(); 55 if (anInstance == nullptr) { << 53 56 // create particle << 54 // create decay channels 57 // << 55 G4VDecayChannel** mode = new G4VDecayChannel*[2]; 58 // Arguments for constructor are as fol << 56 // kaon0 -> Kaon0L 59 // name mass << 57 mode[0] = new G4PhaseSpaceDecayChannel("anti_kaon0",0.500,1,"kaon0L"); 60 // 2*spin parity C- << 58 // kaon0 -> Kaon0S 61 // 2*Isospin 2*Isospin3 << 59 mode[1] = new G4PhaseSpaceDecayChannel("anti_kaon0",0.500,1,"kaon0S"); 62 // type lepton number ba << 63 // stable lifetime << 64 // shortlived subType << 65 << 66 // clang-format off << 67 anInstance = new G4ParticleDefinition( << 68 name, 0.497614*GeV, << 69 0, -1, << 70 1, 1, << 71 "meson", 0, << 72 false, 0.0, << 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 // kaon0 -> Kaon0L << 82 mode[0] = new G4PhaseSpaceDecayChannel("an << 83 // kaon0 -> Kaon0S << 84 mode[1] = new G4PhaseSpaceDecayChannel("an << 85 << 86 for (G4int index = 0; index < 2; index++) << 87 table->Insert(mode[index]); << 88 delete[] mode; << 89 60 90 anInstance->SetDecayTable(table); << 61 for (G4int index=0; index <2; index++ ) table->Insert(mode[index]); 91 } << 62 delete [] mode; 92 theInstance = static_cast<G4AntiKaonZero*>(a << 63 93 return theInstance; << 64 SetDecayTable(table); 94 } << 95 65 96 G4AntiKaonZero* G4AntiKaonZero::AntiKaonZeroDe << 97 { << 98 return Definition(); << 99 } 66 } 100 67 101 G4AntiKaonZero* G4AntiKaonZero::AntiKaonZero() << 68 // ...................................................................... >> 69 // ... static member definitions ... >> 70 // ...................................................................... >> 71 // >> 72 // Arguments for constructor are as follows >> 73 // name mass width charge >> 74 // 2*spin parity C-conjugation >> 75 // 2*Isospin 2*Isospin3 G-parity >> 76 // type lepton number baryon number PDG encoding >> 77 // stable lifetime decay table >> 78 >> 79 G4AntiKaonZero G4AntiKaonZero::theAntiKaonZero( >> 80 "anti_kaon0", 0.497672*GeV, 0.0*MeV, 0.0, >> 81 0, -1, 0, >> 82 1, 1, 0, >> 83 "meson", 0, 0, -311, >> 84 false, 0.0, NULL >> 85 ); >> 86 >> 87 G4AntiKaonZero* G4AntiKaonZero::AntiKaonZeroDefinition(){return &theAntiKaonZero;} >> 88 // initialization for static cut values >> 89 G4double G4AntiKaonZero::theAntiKaonZeroLengthCut = -1.0; >> 90 G4double* G4AntiKaonZero::theAntiKaonZeroKineticEnergyCuts = NULL; >> 91 >> 92 // ********************************************************************** >> 93 // **************************** SetCuts ********************************* >> 94 // ********************************************************************** >> 95 // In this version Input Cut Value is meaning less >> 96 // theKineticEnergyCuts for all materials are set to LowestEnergy >> 97 >> 98 void G4AntiKaonZero::SetCuts(G4double aCut) 102 { 99 { 103 return Definition(); << 100 theCutInMaxInteractionLength = aCut; >> 101 >> 102 const G4MaterialTable* materialTable = G4Material::GetMaterialTable(); >> 103 // Create the vector of cuts in energy >> 104 // corresponding to the stopping range cut >> 105 if(theKineticEnergyCuts) delete [] theKineticEnergyCuts; >> 106 theKineticEnergyCuts = new G4double [materialTable->length()]; >> 107 >> 108 // Build range vector for every material, convert cut into energy-cut, >> 109 // fill theKineticEnergyCuts and delete the range vector >> 110 for (G4int J=0; J<materialTable->length(); J++) >> 111 { >> 112 G4Material* aMaterial = (*materialTable)[J]; >> 113 theKineticEnergyCuts[J] = LowestEnergy; >> 114 } >> 115 theAntiKaonZeroLengthCut = theCutInMaxInteractionLength; >> 116 theAntiKaonZeroKineticEnergyCuts = theKineticEnergyCuts; 104 } 117 } >> 118 105 119