Skip to content

Commit

Permalink
Adding new constants to Hal::Const, adding file to extend PdgDatabase
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielWielanek committed Jan 15, 2025
1 parent 70329cb commit 9c18239
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions features/Const.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,22 @@
* Warsaw University of Technology, Faculty of Physics
*/
#include "Const.h"

#include <TDatabasePDG.h>
#include <TParticlePDG.h>

namespace Hal {
Const::Const() {}

Const::~Const() {}

void Const::ExtendPdgDatabase(TString inFile) {
if (inFile.Length() == 0) {
auto PDG = TDatabasePDG::Instance();
if (!PDG->GetParticle(Const::DeuteronPID())) {
PDG->AddParticle("Deuteron", "Deuteron", Const::DeuteronMass(), kTRUE, 0, 1, "Ion", Const::DeuteronPID(), 0);
PDG->AddParticle("Anti-Deuteron", "Anti-Deuteron", Const::DeuteronMass(), kTRUE, 0, -1, "Ion", -Const::DeuteronPID(), 1);
}
}
}
} // namespace Hal
15 changes: 15 additions & 0 deletions features/Const.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/
#include <TObject.h>
#include <TString.h>

namespace Hal {
class Const {
public:
Expand All @@ -28,6 +30,13 @@ namespace Hal {
static Int_t KaonZeroLongPID() { return 130; }
static Int_t KaonZeroShortPID() { return 310; }
static Int_t ProtonPID() { return 2212; };
static Int_t DeuteronPID() { return 1000010020; };
static Int_t TritonPID() { return 1000010030; };
static Int_t HyperTritonPID() { return 1010010030; };
static Int_t HyperHydrogen4PID() { return 1010010040; };
static Int_t HyperHelium4PID() { return 1010020040; };
static Int_t Helium3PID() { return 1000020030; };
static Int_t Helium4PID() { return 1000020040; };
static Int_t LambdaPID() { return 3122; };
static Int_t NeutronPID() { return 2112; };
static Int_t DeltaPlusPID() { return 2214; }
Expand All @@ -47,6 +56,12 @@ namespace Hal {
static Double_t LambdaMass() { return 1.115638; };
static Double_t NeutronMass() { return 0.939565; }
static Double_t KaonZeroMass() { return 0.497611; };
static Double_t DeuteronMass() { return 1.875; };
/**
* add new particles to PDG database
* @param inFile file with additional particles - TODO implement this function, now only deuteron is added
*/
static void ExtendPdgDatabase(TString inFile = "");
inline static Double_t PiTo32() { return 5.56832799683170787119479427929036; };
inline static Double_t PiTo32Over() { return 0.17958712212516655948313371027325; };
inline static Double_t Sqrt3() { return 1.73205080756887719317660412343685; };
Expand Down

0 comments on commit 9c18239

Please sign in to comment.