Go to the documentation of this file.
18 #include "TObjArray.h"
19 #include "TObjString.h"
33 Error(
"PStaticData",
"Data base could not be filled");
87 if (key < 0) Warning(
"PStaticData",
"std_set not found");
89 while (
makeDataBase()->MakeListIterator(key,
"snpart",
"slink", &listkey)) {
116 AddAlias(
"DP33++",
"Delta(1600)++");
121 AddAlias(
"DS31++",
"Delta(1620)++");
137 (*system_alloc_verbosity) = 1.;
179 if (skey < 0)
return -1;
183 if (skey < 0)
return -1;
200 if (batch_value_param < 0)
202 "batch_value",
"Double storage for batch");
204 if (!
makeDataBase()->GetParamDouble(key_a, batch_value_param, &val)) {
206 Double_t* delme =
new Double_t(0.);
223 if (warn) { Warning(
"GetParticleID",
"%s not found",
id); }
235 Warning(
"GetParticleName",
"id %i not found",
id);
253 Warning(
"GetParticleKey",
"id %i not found",
id);
262 Warning(
"GetDecayKey",
"id %i not found",
id);
283 if ((
id > 500) && (
id < 1000))
return id;
293 if (pid < 0)
return 0;
303 if ((pkey = base->
AddListEntry(old_name,
"nalias",
"lalias", new_name)) < 0) {
304 Warning(
"AddAlias",
"Name %s not found", old_name);
312 Int_t listkey = -1, *dummy;
314 if (key < 0)
return -1;
325 Int_t listkey = -1, *dummy;
326 if (key < 0)
return -1;
347 if (key < 0)
return -1;
357 if (*dummy == defkey)
return listkey;
372 Warning(
"AddParticle",
"pid %i already used in data base", pid);
377 Warning(
"AddParticle",
"Name %s already used in data base", name);
390 if ((pkey = base->
AddListEntry(
"std_set",
"snpart",
"slink", name)) < 0) {
391 Warning(
"AddParticle",
"particle header not found");
395 Int_t* ii =
new int(pid);
400 Double_t* dd =
new double(0.);
405 dd =
new Double_t(mass);
410 dd =
new Double_t(mass);
416 if (!base->
SetParamInt(pkey,
"meson", ii))
return -1;
418 if (!base->
SetParamInt(pkey,
"baryon", ii))
return -1;
420 if (!base->
SetParamInt(pkey,
"lepton", ii))
return -1;
422 if (!base->
SetParamInt(pkey,
"charge", ii))
return -1;
424 if (!base->
SetParamInt(pkey,
"spin", ii))
return -1;
426 if (!base->
SetParamInt(pkey,
"parity", ii))
return -1;
428 if (!base->
SetParamInt(pkey,
"ispin", ii))
return -1;
430 if (!base->
SetParamInt(pkey,
"pythiakf", ii))
return -1;
432 if (!base->
SetParamInt(pkey,
"widx", ii))
return -1;
434 if (!base->
SetParamInt(pkey,
"tdepth", ii))
return -1;
436 if (!base->
SetParamInt(pkey,
"hdepth", ii))
return -1;
449 Int_t listkey = -1, alias_printed = 0;
453 makeDataBase()->MakeListIterator(key,
"nalias",
"lalias", &listkey)) {
459 if (alias_printed) cout << endl;
462 cout <<
"This particle is stable" << endl;
466 cout <<
"This particle decays via the following modes:" << endl;
471 while (
makeDataBase()->MakeListIterator(key,
"pnmodes",
"link", &listkey)) {
480 Warning(
"GetParticleKF",
"id %i not found",
id);
493 Warning(
"GetParticleIDbyKF",
"invalid kf code %i", *
id);
603 cout <<
"PStaticData::Charge: " <<
id <<
" not found" << endl;
613 cout <<
"PStaticData::Charge: " <<
id <<
" not found" << endl;
622 cout <<
"PStaticData::GetParticleSpin: " <<
id <<
" not found" << endl;
632 cout <<
"PStaticData::GetParticleSpin: " <<
id <<
" not found" << endl;
641 cout <<
"PStaticData::GetParticleIsospin: " <<
id <<
" not found" << endl;
651 cout <<
"PStaticData::GetParticleIsospin: " <<
id <<
" not found" << endl;
660 cout <<
"PStaticData::GetParticleParity: " <<
id <<
" not found" << endl;
670 cout <<
"PStaticData::GetParticleParity: " <<
id <<
" not found" << endl;
680 cout <<
"PStaticData::GetParticleMass: " <<
id <<
" not found" << endl;
690 cout <<
"PStaticData::GetParticleMass: " <<
id <<
" not found" << endl;
699 cout <<
"PStaticData::GetParticleMassByKey: " <<
id <<
" not found" << endl;
708 cout <<
"PStaticData::SetParticleMass: " <<
id <<
" not found" << endl;
717 cout <<
"PStaticData::SetParticleMass: " <<
id <<
" not found" << endl;
741 cout <<
"PStaticData::SetTWidth: " <<
id <<
" not found" << endl;
757 cout <<
"PStaticData::SetTWidth: " <<
id <<
" not found" << endl;
764 printf(
"\n*** Warning: Use only at start of macro! ***\n\n");
774 cout <<
"PStaticData::GetTWidx: " <<
id <<
" not found" << endl;
787 cout <<
"PStaticData::GetPWidx: " <<
id <<
" not found" << endl;
799 cout <<
"PStaticData::SetTWidx: " <<
id <<
" not found" << endl;
810 cout <<
"PStaticData::GetPWidx: " <<
id <<
" not found" << endl;
819 cout <<
"PStaticData::SetTWidx: " <<
id <<
" not possible" << endl;
826 cout <<
"PStaticData::GetTWidthMesh: " <<
id <<
" not found" << endl;
835 cout <<
"PStaticData::SetPWidthMesh: " <<
id <<
" not possible" << endl;
842 cout <<
"PStaticData::GetPWidthMesh: " <<
id <<
" not found" << endl;
852 cout <<
"PStaticData::SetTF1: " <<
id <<
" not possible" << endl;
869 cout <<
"PStaticData::GetDecayEmin: " <<
id <<
" not found" << endl;
886 Int_t* ii =
new Int_t(flag);
902 Warning(
"SetTotalNormalization",
"Invalid particle");
906 while (
makeDataBase()->MakeListIterator(key,
"pnmodes",
"link", &listkey)) {
908 Int_t* ii =
new Int_t(flag);
909 if (!
makeDataBase()->SetParamInt(listkey,
"brflag", ii)) {
922 cout <<
"PStaticData::SetDecayEmin: " <<
id <<
" not found" << endl;
930 cout <<
"PStaticData::GetParticleEmin: " <<
id <<
" not found" << endl;
939 cout <<
"PStaticData::SetParticleEmin: " <<
id <<
" not found" << endl;
946 Warning(
"GetParticleLMass",
"id %i not found",
id);
964 Warning(
"GetParticleUMass",
"id %i not found",
id);
982 cout <<
"PStaticData::GetTDepth: " <<
id <<
" not found" << endl;
990 cout <<
"PStaticData::GetTDepth: " <<
id <<
" not found" << endl;
997 cout <<
"PStaticData::GetHDepth: " <<
id <<
" not found" << endl;
1005 cout <<
"PStaticData::GetHDepth: " <<
id <<
" not found" << endl;
1012 cout <<
"PStaticData::GetDecayBR: " <<
id <<
" not found" << endl;
1034 if (!
makeDataBase()->GetParamDouble(key,
"brorig", &brorig))
return kFALSE;
1038 br = (other * br) / (1. - br);
1050 if (!
makeDataBase()->GetParamDouble(key,
"brorig", &brorig))
return kFALSE;
1054 br = (other * br) / (1. - br);
1062 const char* daughters,
1083 if (parent_key < 0) {
1084 cout <<
"PStaticData::SetDecayBR: parent " << parent
1085 <<
" not found in data base" << endl;
1090 if (pid < 0) {
return kFALSE; }
1097 Tokenize(daughters,
",", arr1, &arr1_s);
1101 for (
int pat = 0; pat < arr1_s; pat++) {
1108 if (decay_key < 0) {
1109 Warning(
"SetDecayBR",
"Decay %s -> %s not defined", parent, daughters);
1143 Double_t *br, *brorig, *width;
1148 while (
makeDataBase()->MakeListIterator(key,
"pnmodes",
"link", &listkey)) {
1149 if (!
makeDataBase()->GetParamDouble(listkey,
"brorig", &brorig))
1156 while (
makeDataBase()->MakeListIterator(key,
"pnmodes",
"link", &listkey)) {
1157 if (!
makeDataBase()->GetParamDouble(listkey,
"brorig", &brorig))
1159 if (!
makeDataBase()->GetParamDouble(listkey,
"br", &br))
return kFALSE;
1160 *br = *brorig / sum;
1161 if (
makeDataBase()->GetParamDouble(listkey,
"width", &width)) {
1162 *width = *br * twidth;
1170 Fatal(
"FreezeDecayBR",
"not implemented");
1210 for (
int i = 1;
i < tid[0];
i++) {
1383 key, 0,
"name,didx,br,d1:name,d2:name,d3:name,d4:name");
1386 key, 0,
"name,didx,br,d1:name,d2:name,d3:name,d4:name,d5:name");
1389 key, 0,
"name,didx,br,d1:name,d2:name,d3:name,d4:name,d5:name,d6:name");
1394 "name,didx,br,d1:name,d2:name,d3:name,d4:name,d5:name,d6:name,d7:name");
1471 if (n < 2 || !pid)
return -1;
1472 for (
i = 0;
i <= n; ++
i) {
1474 cout <<
"PStaticData:: GetDecayIdx: id not found:" << pid[
i] << endl;
1477 nid[
i - 1] = pid[
i];
1481 int id = pid[0], *nm;
1493 while (
makeDataBase()->MakeListIterator(key,
"pnmodes",
"link", &listkey)) {
1499 for (
i = 0;
i < n; ++
i)
1500 count += (tid[
i + 1] == nid[
i]);
1517 if (n < 1 || !pid)
return -1;
1518 for (
i = 0;
i <= n; ++
i) {
1520 Warning(
"GetDecayKey",
"id %i not found", pid[
i]);
1523 nid[
i - 1] = pid[
i];
1529 int id = pid[0], *nm;
1540 while (
makeDataBase()->MakeListIterator(key,
"pnmodes",
"link", &listkey)) {
1546 for (
i = 0;
i < n; ++
i)
1547 count += (tid[
i + 1] == nid[
i]);
1572 Int_t *d1_key, *d2_key, *d3_key, *d4_key, *d5_key, *d6_key, *d7_key,
1591 cout <<
"PStaticData:: size too low" << endl;
1596 Int_t *d1_p =
nullptr, *d2_p =
nullptr, *d3_p =
nullptr, *d4_p =
nullptr,
1597 *d5_p =
nullptr, *d6_p =
nullptr, *d7_p =
nullptr;
1599 cout <<
"PStaticData:: Mode: unable to unpack key1 " << *d1_key << endl;
1601 }
else if ((found > 1)
1603 cout <<
"PStaticData:: Mode: unable to unpack key2 " << *d2_key << endl;
1605 }
else if ((found > 2)
1607 cout <<
"PStaticData:: Mode: unable to unpack key3 " << *d3_key << endl;
1609 }
else if ((found > 3)
1611 cout <<
"PStaticData:: Mode: unable to unpack key4 " << *d4_key << endl;
1613 }
else if ((found > 4)
1615 cout <<
"PStaticData:: Mode: unable to unpack key5 " << *d5_key << endl;
1617 }
else if ((found > 5)
1619 cout <<
"PStaticData:: Mode: unable to unpack key6 " << *d6_key << endl;
1621 }
else if ((found > 6)
1623 cout <<
"PStaticData:: Mode: unable to unpack key7 " << *d7_key << endl;
1626 if (d1_p)
id[1] = *d1_p;
1627 if (d2_p)
id[2] = *d2_p;
1628 if (d3_p)
id[3] = *d3_p;
1629 if (d4_p)
id[4] = *d4_p;
1630 if (d5_p)
id[5] = *d5_p;
1631 if (d6_p)
id[6] = *d6_p;
1632 if (d7_p)
id[7] = *d7_p;
1638 Int_t *d1_key, *d2_key, *d3_key, *d4_key, *d5_key, *d6_key, *d7_key,
1649 cout <<
"PStaticData:: size too low" << endl;
1655 Int_t *d1_p =
nullptr, *d2_p =
nullptr, *d3_p =
nullptr, *d4_p =
nullptr,
1656 *d5_p =
nullptr, *d6_p =
nullptr, *d7_p =
nullptr;
1658 cout <<
"PStaticData:: ModeByKey: unable to unpack key1 " << *d1_key
1663 cout <<
"PStaticData:: ModeByKey: unable to unpack key2 " << *d2_key
1668 cout <<
"PStaticData:: ModeByKey: unable to unpack key3 " << *d3_key
1673 cout <<
"PStaticData:: ModeByKey: unable to unpack key4 " << *d4_key
1678 cout <<
"PStaticData:: ModeByKey: unable to unpack key5 " << *d5_key
1683 cout <<
"PStaticData:: ModeByKey: unable to unpack key6 " << *d6_key
1688 cout <<
"PStaticData:: ModeByKey: unable to unpack key7 " << *d7_key
1692 if (d1_p)
id[1] = *d1_p;
1693 if (d2_p)
id[2] = *d2_p;
1694 if (d3_p)
id[3] = *d3_p;
1695 if (d4_p)
id[4] = *d4_p;
1696 if (d5_p)
id[5] = *d5_p;
1697 if (d6_p)
id[6] = *d6_p;
1698 if (d7_p)
id[7] = *d7_p;
1705 cout <<
"PStaticData::GetParticleTotalWidth: " <<
id <<
" not found"
1715 cout <<
"PStaticData::GetParticleTotalWidthByKey: " << key <<
" not found"
1736 const char* delimiter,
1739 for (
int i = 0;
i < *size;
i++)
1742 char* mystack =
new char[strlen(options) + 1];
1743 strcpy(mystack, options);
1748 while (strstr(mystack, delimiter)) {
1750 cout <<
"Tokenize: size " << *size <<
" is too small for " << options
1751 <<
" ,delim:" << delimiter << endl;
1753 char*
pos = strstr(mystack, delimiter);
1755 mystack =
pos + strlen(delimiter);
1756 array[pat] = mystack;
1763 for (
int i = 0;
i < *size;
i++) {
1774 while (**partc ==
' ')
1776 if (strlen(*partc)) {
1777 int partend = strlen(*partc) - 1;
1779 while ((*partc)[partend] ==
' ' && partend >= 0) {
1780 (*partc)[partend] =
'\0';
1788 int i, j, l,
m, r, rt[20], lt[20], level = 1;
1809 while (*(a +
i - 1) <
x)
1811 while (*(a + j - 1) >
x)
1815 *(a +
i - 1) = *(a + j - 1);
1822 if (r -
i >= j - l) {
int GetDecayBRFlag(int didx)
void SetPWidx(const int &, const int &)
TF1 * GetTF1(const int &)
void SetTF1(const int &, TF1 *mesh)
int GetParticleKF(const int Id)
int IsParticleMeson(const int &id)
int GetParticleIsospin(const int &id)
int GetAliasParent(const char *alias_name)
Int_t IsDecayHadronic(Int_t didx)
const char * GetName(Int_t key)
void SetDecayBRFlag(int didx, int flag)
void SetDecayEmin(const int &idx, const double v)
void SetParticleParity(const char *id, Int_t parity)
int GetParticleIDbyKF(const int kf)
Int_t GetParamString(const char *paramname)
Double_t * GetBatchValue(const char *name, Int_t make_val=1)
void SetTWidthMesh(const int &, PMesh *mesh)
void FreezeDecayBR(Int_t id, Int_t brn)
void SetParticleCharge(const char *id, Int_t charge)
int MakeDirectoryEntry(const char *name, const char *n, const char *l, const char *ename)
void SetParticleTotalWidth(Int_t id, Float_t wid)
double GetParticleTotalWidthByKey(const int &id)
int AddParticle(int pid, const char *name, double mass)
void GetDecayMode(const int, int *n)
Double_t GetDecayBR(Int_t id)
static void isort(int *i, int n)
void SetParticleUMass(const int &id, const double v)
static void dsort(Double_t *, int)
const char * GetDecayName(Int_t id)
double GetParticleLMass(const int &id)
double GetParticleMassByKey(const int &id)
int GetParticleBaryon(const int &id)
int GetPWidx(const int &)
int GetDecayParent(const int &)
PStaticData * makeStaticData()
int AddAlias(const char *old_name, const char *new_name)
PDataBase * makeDataBase()
int GetTWidx(const int &)
void SetTDepth(const int &, const int &)
Int_t MakeParamDouble(const char *paramname, const char *descr)
int GetTDepth(const int &)
int GetParticleNChannels(const int &id)
int GetDecayIdxByKey(int key)
bool SetDecayBRByKey(int key, double br, int mode)
PStaticData & fStaticData()
int GetSecondaryKey(int key, int defkey)
int GetParticleSpin(const int &id)
int GetDecayKey(int *pid, int n)
int GetParticleIDByKey(int key)
int GetParticleCharge(const int &id)
Double_t * system_alloc_verbosity
void SetParticleLepton(const char *id, Int_t num=1)
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
PMesh * GetPWidthMesh(const int &)
int GetParticleID(const char *id, int warn=1)
void SetParticleMeson(const char *id, Int_t num=1)
const char * GetDecayNameByKey(Int_t key)
int IsParticle(const int &id, const char *name)
int GetHDepth(const int &)
int GetParticleLepton(const int &id)
Bool_t SetParamInt(Int_t key, const char *paramname, Int_t *result)
PMesh * GetTWidthMesh(const int &)
double GetParticleEmin(const int &id)
Int_t GetEntryInt(const char *paramname, Int_t value)
Double_t GetDecayPartialWidthByKey(Int_t id)
int GetParticleNChannelsByKey(int id)
Int_t GetParamTObj(const char *paramname)
double GetParticleTotalWidth(const int &id)
int GetDecayNProducts(const int &)
void listParticle(int id)
void SetParticleSpin(const char *id, Int_t spin)
void SetTotalNormalization(char *p, int flag=1)
void SetTWidx(const int &, const int &)
void SetParticleIsospin(const char *id, Int_t isospin)
int GetParticleParity(const int &id)
static Bool_t Tokenize(const char *options, const char *delimiter, char **array, int *size)
Bool_t AddEntry(Int_t key, const char *name)
void SetParticleEmin(const int &id, const double v)
void GetDecayModeByKey(const int, int *n)
int GetDecayNProductsByKey(const int &key)
void SetParticleLMass(const int &id, const double v)
Int_t GetParamInt(const char *paramname, Int_t length=-1)
Bool_t ListEntries(Int_t key=-1, Int_t option=0, const char *pattern=nullptr)
void PrintDecayByKey(int key)
Double_t GetDecayPartialWidth(Int_t id)
const char * GetParticleName(const int &id)
int GetParticleKey(const int &id)
Int_t AddListEntry(const char *name, const char *count, const char *link, const char *newname)
static void remove_spaces(char **partc)
double GetParticleMass(const int &id)
void SetPWidthMesh(const int &, PMesh *mesh)
Int_t MakeParamInt(const char *paramname, const char *descr)
Bool_t SetParamDouble(Int_t key, const char *paramname, Double_t *result)
int GetDecayParentByKey(const int &)
void clearFreezeOut(void)
int GetDecayIdx(int *pid, int n)
bool SetDecayBR(int didx, double br, int mode)
void SetParticleBaryon(const char *id, Int_t num=1)
void SetParticleMass(Int_t id, Float_t mass)
int IsParticleValid(const int &id)
void PrintParticleByKey(int pid)
void PrintParticle(int pid)
bool NormParticleBR(Int_t id)
Int_t GetParamDouble(const char *paramname)
void SetHDepth(const int &, const int &)
int IsParticleHadron(const int &id)
double GetParticleUMass(const int &id)
bool NormParticleBRbyKey(Int_t key)
double GetDecayEmin(const int &idx)
Int_t GetEntry(const char *name)