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: G4AntiNeutron.cc,v 1.4 2000/02/27 06:17:03 kurasige Exp $ >> 9 // GEANT4 tag $Name: geant4-02-00 $ >> 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 7 July 19 // H.Kurashige 7 July 1996 32 // ******************************************* 20 // ********************************************************************** 33 // New impelemenataion as an utility class M << 21 #include "g4std/fstream" 34 // ------------------------------------------- << 22 #include "g4std/iomanip" 35 23 36 #include "G4AntiNeutron.hh" 24 #include "G4AntiNeutron.hh" 37 25 38 #include "G4DecayTable.hh" << 26 // ###################################################################### 39 #include "G4NeutronBetaDecayChannel.hh" << 27 // ### ANTI NEUTRON ### 40 #include "G4ParticleTable.hh" << 28 // ###################################################################### 41 #include "G4PhysicalConstants.hh" << 29 42 #include "G4String.hh" << 30 G4AntiNeutron::G4AntiNeutron( 43 #include "G4SystemOfUnits.hh" << 31 const G4String& aName, G4double mass, 44 #include "G4Types.hh" << 32 G4double width, G4double charge, 45 #include "G4VDecayChannel.hh" << 33 G4int iSpin, G4int iParity, 46 << 34 G4int iConjugation, G4int iIsospin, 47 G4AntiNeutron* G4AntiNeutron::theInstance = nu << 35 G4int iIsospin3, G4int gParity, 48 << 36 const G4String& pType, G4int lepton, 49 G4AntiNeutron* G4AntiNeutron::Definition() << 37 G4int baryon, G4int encoding, >> 38 G4bool stable, G4double lifetime, >> 39 G4DecayTable *decaytable ) >> 40 : G4VBaryon( aName,mass,width,charge,iSpin,iParity, >> 41 iConjugation,iIsospin,iIsospin3,gParity,pType, >> 42 lepton,baryon,encoding,stable,lifetime,decaytable ) 50 { 43 { 51 if (theInstance != nullptr) return theInstan << 44 SetParticleSubType("nucleon"); 52 const G4String name = "anti_neutron"; << 45 } 53 // search in particle table] << 46 54 G4ParticleTable* pTable = G4ParticleTable::G << 47 // ...................................................................... 55 G4ParticleDefinition* anInstance = pTable->F << 48 // ... static member definitions ... 56 if (anInstance == nullptr) { << 49 // ...................................................................... 57 // create particle << 50 // 58 // << 51 // Arguments for constructor are as follows 59 // Arguments for constructor are as fol << 52 // name mass width charge 60 // name mass << 53 // 2*spin parity C-conjugation 61 // 2*spin parity C- << 54 // 2*Isospin 2*Isospin3 G-parity 62 // 2*Isospin 2*Isospin3 << 55 // type lepton number baryon number PDG encoding 63 // type lepton number ba << 56 // stable lifetime decay table 64 // stable lifetime << 57 // 65 // shortlived subType << 58 G4AntiNeutron G4AntiNeutron::theAntiNeutron( 66 // use constants in CLHEP << 59 "anti_neutron", 0.93956563*GeV, 0.0*MeV, 0.0, 67 // static const double neutron_mass_c2 = << 68 // clang-format off << 69 anInstance = new G4ParticleDefinition( << 70 name, neutron_mass_c2, 7.478e << 71 1, +1, 0, 60 1, +1, 0, 72 1, +1, 0, 61 1, +1, 0, 73 "baryon", 0, - 62 "baryon", 0, -1, -2112, 74 false, 880.2*second, nullptr, << 63 true, -1.0, NULL 75 false, "nucleon", 211 << 64 ); 76 ); << 65 G4AntiNeutron* G4AntiNeutron::AntiNeutronDefinition(){return &theAntiNeutron;} 77 // clang-format on << 66 // initialization for static cut values 78 << 67 G4double G4AntiNeutron::theAntiNeutronLengthCut = -1.0; 79 // Magnetic Moment << 68 G4double* G4AntiNeutron::theAntiNeutronKineticEnergyCuts = NULL; 80 G4double mN = eplus * hbar_Planck / 2. / ( << 81 anInstance->SetPDGMagneticMoment(1.9130427 << 82 // create Decay Table << 83 auto table = new G4DecayTable(); << 84 // create a decay channel << 85 G4VDecayChannel* mode = new G4NeutronBetaD << 86 table->Insert(mode); << 87 anInstance->SetDecayTable(table); << 88 } << 89 theInstance = static_cast<G4AntiNeutron*>(an << 90 return theInstance; << 91 } << 92 69 93 G4AntiNeutron* G4AntiNeutron::AntiNeutronDefin << 70 // ********************************************************************** >> 71 // **************************** SetCuts ********************************* >> 72 // ********************************************************************** >> 73 // In this version Input Cut Value is meaning less >> 74 // theKineticEnergyCuts for all materials are set to LowestEnergy >> 75 void G4AntiNeutron::SetCuts(G4double aCut) 94 { 76 { 95 return Definition(); << 77 theCutInMaxInteractionLength = aCut; 96 } << 97 78 98 G4AntiNeutron* G4AntiNeutron::AntiNeutron() << 79 const G4MaterialTable* materialTable = G4Material::GetMaterialTable(); 99 { << 80 // Create the vector of cuts in energy 100 return Definition(); << 81 // corresponding to the stopping range cut >> 82 if(theKineticEnergyCuts) delete [] theKineticEnergyCuts; >> 83 theKineticEnergyCuts = new G4double [materialTable->length()]; >> 84 >> 85 // Build range vector for every material, convert cut into energy-cut, >> 86 // fill theKineticEnergyCuts and delete the range vector >> 87 for (G4int J=0; J<materialTable->length(); J++) >> 88 { >> 89 G4Material* aMaterial = (*materialTable)[J]; >> 90 theKineticEnergyCuts[J] = LowestEnergy; >> 91 } >> 92 theAntiNeutronLengthCut = theCutInMaxInteractionLength; >> 93 theAntiNeutronKineticEnergyCuts = theKineticEnergyCuts; >> 94 // Rebuild the physics tables for every process for this particle type >> 95 101 } 96 } >> 97 >> 98 >> 99 >> 100 >> 101 >> 102 >> 103 >> 104 >> 105 >> 106 102 107