Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-10 02:21:24

0001 
0002 #include "SimG4Core/CustomPhysics/interface/CMSSIMP.h"
0003 #include "G4PhysicalConstants.hh"
0004 #include <CLHEP/Units/SystemOfUnits.h>
0005 #include "G4ParticleTable.hh"
0006 
0007 #include "G4PhaseSpaceDecayChannel.hh"
0008 #include "G4DecayTable.hh"
0009 
0010 CMSSIMP* CMSSIMP::theInstance = nullptr;
0011 
0012 CMSSIMP* CMSSIMP::Definition(double mass) {
0013   if (theInstance != nullptr)
0014     return theInstance;
0015   const G4String name = "chi";
0016   // search in particle table]
0017   G4ParticleTable* pTable = G4ParticleTable::GetParticleTable();
0018   G4ParticleDefinition* anInstance = pTable->FindParticle(name);
0019   if (anInstance == nullptr) {
0020     // create particle
0021     //
0022     //    Arguments for constructor are as follows
0023     //               name             mass          width         charge
0024     //             2*spin           parity  C-conjugation
0025     //          2*Isospin       2*Isospin3       G-parity
0026     //               type    lepton number  baryon number   PDG encoding
0027     //             stable         lifetime    decay table
0028     //             shortlived      subType    anti_encoding
0029 
0030     anInstance = new G4ParticleDefinition(
0031         name, mass, 0, 0.0, 1, +1, 0, 0, -1, 0, "simp", 0, +1, 9000006, true, -1.0, nullptr, false, "nucleon");
0032   }
0033   theInstance = reinterpret_cast<CMSSIMP*>(anInstance);
0034   return theInstance;
0035 }
0036 
0037 CMSSIMP* CMSSIMP::SIMPDefinition(double mass) { return Definition(mass); }
0038 
0039 CMSSIMP* CMSSIMP::SIMP() {
0040   return Definition(1 * CLHEP::GeV);  // will use correct mass if instance exists
0041 }