/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
SimG4Core/CustomPhysics/src/CMSSIMP.cc
40 строк
1 KB
Slava Krutelyov
G4SystemOfUnits.hh -> CLHEP/Units/SystemOfUnits to avoid numerous single character symbols in global scope
01 май 2024, 18:34
01 май 2024, 18:34
c17eac0
Код
Авторство
О чём код?
#include "SimG4Core/CustomPhysics/interface/CMSSIMP.h" #include "G4PhysicalConstants.hh" #include <CLHEP/Units/SystemOfUnits.h> #include "G4ParticleTable.hh" #include "G4PhaseSpaceDecayChannel.hh" #include "G4DecayTable.hh" CMSSIMP* CMSSIMP::theInstance = nullptr; CMSSIMP* CMSSIMP::Definition(double mass) { if (theInstance != nullptr) return theInstance; const G4String name = "chi"; // search in particle table] G4ParticleTable* pTable = G4ParticleTable::GetParticleTable(); G4ParticleDefinition* anInstance = pTable->FindParticle(name); if (anInstance == nullptr) { // create particle // // Arguments for constructor are as follows // name mass width charge // 2*spin parity C-conjugation // 2*Isospin 2*Isospin3 G-parity // type lepton number baryon number PDG encoding // stable lifetime decay table // shortlived subType anti_encoding anInstance = new G4ParticleDefinition( name, mass, 0, 0.0, 1, +1, 0, 0, -1, 0, "simp", 0, +1, 9000006, true, -1.0, nullptr, false, "nucleon"); } theInstance = reinterpret_cast<CMSSIMP*>(anInstance); return theInstance; } CMSSIMP* CMSSIMP::SIMPDefinition(double mass) { return Definition(mass); } CMSSIMP* CMSSIMP::SIMP() { return Definition(1 * CLHEP::GeV); // will use correct mass if instance exists }