#ifndef _PSTATICDATA_H_
#define _PSTATICDATA_H_
#include "TROOT.h"
#include "TF1.h"
#include <iostream>
#include "PDataBase.h"
#include "PMesh.h"
#define MAX_DAUGHTERS 7
using namespace std;
class PStaticData;
PStaticData *makeStaticData();
PStaticData &fStaticData();
void listParticle(int id = -1);
void listParticle(const char *id);
void listModes(int id = -1);
void listModes(const char *id);
class PStaticData : public TObject {
public:
PStaticData();
void SetFreezeOut(void) {
freeze = kTRUE;
};
void clearFreezeOut(void) {
freeze = kFALSE;
};
bool GetFreezeOut(void) {
return freeze;
}
int AddAlias(const char *old_name,
const char *new_name);
int GetAliasParent(const char *alias_name);
int GetAliasParent(int key);
int MakeDirectoryEntry(const char *name, const char *n, const char *l,
const char *ename);
Double_t *GetBatchValue(const char *name, Int_t make_val=1);
bool SetBatchValue(const char *name, Double_t val) {
Double_t *tmp = GetBatchValue(name);
if (!tmp) return kFALSE;
(*tmp) = val;
return kTRUE;
}
int GetSecondaryKey(int key, int defkey);
int GetParticleID(const char *id, int warn=1);
int GetParticleIDByKey(int key);
const char *GetParticleName(const int &id);
int GetParticleKey(const int &id);
int GetParticleKey(const char *id) {
return GetParticleKey(GetParticleID(id));
};
int IsParticle(const int &id, const char *name);
int IsParticleValid(const int &id);
int IsParticleValid(const char *n);
int AddParticle(int pid, const char *name, double mass);
void PrintParticle(int pid);
void PrintParticleByKey(int pid);
void PrintParticle(const char *id) {
PrintParticle(GetParticleID(id));
};
int GetParticleKF(const int Id);
int GetParticleIDbyKF(const int kf);
int IsParticleMeson(const int &id);
void SetParticleMeson(const char* id, Int_t num=1);
int IsParticleHadron(const int &id);
int GetParticleBaryon(const int &id);
void SetParticleBaryon(const char *id, Int_t num=1);
int GetParticleLepton(const int &id);
void SetParticleLepton(const char *id, Int_t num=1);
int GetParticleCharge(const int &id);
int GetParticleCharge(const char *id);
void SetParticleCharge(const char *id, Int_t charge);
int GetParticleSpin(const int &id);
int GetParticleSpin(const char *id);
void SetParticleSpin(const char *id, Int_t spin);
int GetParticleIsospin(const int &id);
int GetParticleIsospin(const char *id);
void SetParticleIsospin(const char *id, Int_t isospin);
int GetParticleParity(const int &id);
int GetParticleParity(const char *id);
void SetParticleParity(const char *id, Int_t parity);
double GetParticleMass(const int &id);
double GetParticleMass(const char *id);
double GetParticleMassByKey(const int &id);
void SetParticleMass(Int_t id, Float_t mass);
void SetParticleMass(const char *id, Float_t mass);
int GetParticleNChannels(const int &id);
int GetParticleNChannels(const char *id);
int GetParticleNChannelsByKey(int id);
void SetParticleTotalWidth(Int_t id, Float_t wid);
void SetParticleTotalWidth(const char *id, Float_t wid);
double GetParticleTotalWidth(const int &id);
double GetParticleTotalWidth(const char *id) {
return GetParticleTotalWidth(GetParticleID(id));
};
double GetParticleTotalWidthByKey(const int &id);
double GetParticleEmin(const int &id);
void SetParticleEmin(const int &id, const double v);
double GetParticleLMass(const int &id);
double GetParticleLMass(const char *id) {
return GetParticleLMass(GetParticleID(id));
};
double GetParticleUMass(const int &id);
double GetParticleUMass(const char *id) {
return GetParticleUMass(GetParticleID(id));
};
void SetParticleLMass(const int &id, const double v) {
SetParticleLMass(GetParticleName(id),v);
};
void SetParticleLMass(const char *id, const double v);
void SetParticleUMass(const int &id, const double v) {
SetParticleUMass(GetParticleName(id),v);
};
void SetParticleUMass(const char *id, const double v);
bool NormParticleBR(Int_t id);
bool NormParticleBRbyKey(Int_t key);
void SetTotalNormalization(char *p,int flag=1);
void FreezeDecayBR(Int_t id, Int_t brn);
bool SetDecayBR(int didx, double br, int mode);
bool SetDecayBR(const char *parent, const char *daughters, double br, int mode);
bool SetDecayBRByKey(int key, double br, int mode);
Double_t GetDecayBR(Int_t id);
Double_t GetDecayPartialWidth(Int_t id);
Double_t GetDecayPartialWidthByKey(Int_t id);
const char *GetDecayName(Int_t id);
const char *GetDecayNameByKey(Int_t key);
Int_t IsDecayHadronic(Int_t didx);
int AddDecay(int didx, const char *name, const char *parent,
const char *daughters , double br);
int AddDecay(const char *name, const char *parent,
const char *daughters , double br) {
return AddDecay(-1, name, parent,
daughters , br); };
int AddDecay(int *ipid, int n);
void PrintDecayByKey(int key);
int GetDecayNProducts(const int &);
int GetDecayNProducts(const char *);
int GetDecayNProductsByKey(const int &key);
int GetDecayParent(const int &);
int GetDecayParentByKey(const int &);
void GetDecayMode(const int, int *n);
void GetDecayModeByKey(const int, int *n);
int GetDecayIdx(int *pid, int n);
int GetDecayIdx(const char *parent, const char *daughters);
int GetDecayKey(int *pid, int n);
int GetDecayKey(const int &id);
int GetDecayIdxByKey(int key);
int GetDecayBRFlag(int didx);
void SetDecayBRFlag(int didx, int flag);
double GetDecayEmin(const int &idx);
void SetDecayEmin(const int &idx, const double v);
void SetEnhanceChannelBR(const int id, const double factor);
void SetEnhanceChannelBR(const char *parent, const char *decay, Double_t factor = 1.);
void DisableAllChannelBR(const char *parent);
Double_t GetEnhanceChannelBR(const int id);
int GetTWidx(const int &);
int GetPWidx(const int &);
void SetTWidx(const int &, const int &);
void SetPWidx(const int &, const int &);
int GetTDepth(const int &);
void SetTDepth(const int &, const int &);
int GetHDepth(const int &);
void SetHDepth(const int &, const int &);
void SetTWidthMesh(const int &, PMesh *mesh);
PMesh * GetTWidthMesh(const int &);
void SetPWidthMesh(const int &, PMesh *mesh);
PMesh * GetPWidthMesh(const int &);
void SetTF1(const int &, TF1 *mesh);
TF1 * GetTF1(const int &);
friend void listParticle(int id);
friend void listParticle(const char *id) {
listParticle(makeStaticData()->GetParticleID(id));
};
friend void listModes(int id);
friend void listModes(const char *id){
listModes(makeStaticData()->GetParticleID(id));
};
private:
Int_t *i_result;
const char *c_result;
Double_t *d_result;
TObject *t_result;
Int_t pid_param;
Int_t name_param;
Int_t meson_param, baryon_param, lepton_param;
Int_t charge_param, spin_param, ispin_param;
Int_t parity_param, mass_param, width_param;
Int_t pkf_param, didx_param, enhance_br_param;
Int_t widx_param, mesh_param, tf1_param, ethreshold_param, lmass_param, umass_param;
Int_t tdepth_param, hdepth_param, br_param, brorig_param, count_param;
Int_t d1_param, d2_param, d3_param, pnmodes_param, ppid_param;
Int_t d4_param, d5_param, d6_param, d7_param;
Int_t brflag_param;
Int_t nalias_param, lalias_param, defkey_param;
Bool_t freeze;
Double_t *system_alloc_verbosity;
ClassDef(PStaticData, 0)
};
#endif // _PDATAUTIL_H_