CbmRoot
PStaticData.cxx
Go to the documentation of this file.
1 // Pluto Data Wrapper
3 // Provides a lot of helpfull wrapper function to deal with the data
4 // base.
5 //
6 //
7 // Author: M.A. Kagarlis
8 // Written: 31/01/99
9 // Revised: 24/05/2004 R.H.
10 // Reimplemented: 3/5/2007 IF
11 //
13 
14 #include "PStaticData.h"
15 #include "PStdData.h"
16 //#include "PUtils.h"
17 #include "Pdefines.h"
18 #include "TObjArray.h"
19 #include "TObjString.h"
20 #include "TString.h"
21 
22 //extern char*version_string;
23 
25  static PStaticData* ans = new PStaticData();
26  return *ans;
27 }
28 
30 
32  if (!makeStdData()->fillDataBase()) {
33  Error("PStaticData", "Data base could not be filled");
34  exit(1);
35  }
36  PDataBase* base = makeDataBase();
37  i_result = nullptr;
38  c_result = nullptr;
39  d_result = nullptr;
40  t_result = nullptr;
41 
42  freeze = kFALSE;
43 
44  pid_param = base->GetParamInt("pid");
45  name_param = base->GetParamString("name");
46  meson_param = base->GetParamInt("meson");
47  baryon_param = base->GetParamInt("baryon");
48  lepton_param = base->GetParamInt("lepton");
49  charge_param = base->GetParamInt("charge");
50  spin_param = base->GetParamInt("spin");
51  ispin_param = base->GetParamInt("ispin");
52  parity_param = base->GetParamInt("parity");
53  mass_param = base->GetParamDouble("mass");
54  width_param = base->GetParamDouble("width");
55  pkf_param = base->GetParamInt("pkf");
56  didx_param = base->GetParamInt("didx");
57  widx_param = base->GetParamInt("widx");
58  mesh_param = base->GetParamTObj("mesh");
59  tf1_param = base->GetParamTObj("tf1");
60  ethreshold_param = base->GetParamDouble("ethreshold");
61  lmass_param = base->GetParamDouble("lmass");
62  umass_param = base->GetParamDouble("umass");
63  brflag_param = base->GetParamInt("brflag");
64  tdepth_param = base->GetParamInt("tdepth");
65  hdepth_param = base->GetParamInt("hdepth");
66  br_param = base->GetParamDouble("br");
67  brorig_param = base->GetParamDouble("brorig");
68  count_param = base->GetParamInt("pnmodes");
69  d1_param = base->GetParamInt("d1");
70  d2_param = base->GetParamInt("d2");
71  d3_param = base->GetParamInt("d3");
72  d4_param = base->GetParamInt("d4");
73  d5_param = base->GetParamInt("d5");
74  d6_param = base->GetParamInt("d6");
75  d7_param = base->GetParamInt("d7");
76  pnmodes_param = base->GetParamInt("pnmodes");
77  ppid_param = base->GetParamInt("ppid");
78 
79  nalias_param = base->GetParamInt("nalias");
80  lalias_param = base->GetParamInt("lalias");
81 
82 
83  //now loop over particles and normalize BRs
84  //This is very important for the mass sampling
85  Int_t pids = 0;
86  Int_t key = makeDataBase()->GetEntry("std_set");
87  if (key < 0) Warning("PStaticData", "std_set not found");
88  Int_t listkey = -1;
89  while (makeDataBase()->MakeListIterator(key, "snpart", "slink", &listkey)) {
90  //loop over all particles
91  NormParticleBRbyKey(listkey);
92  pids++;
93  }
94 
95  //This is for the ctor of the PChannelModel
96  defkey_param = base->MakeParamInt("defkey", "Model Def Key");
97 
98  //Add some useful aliases
99  //no idea if this is the correct place, it the moment it should be OK
100  AddAlias("dilepton", "dielectron");
101  AddAlias("g", "gamma");
102 
103  AddAlias("w", "omega");
104  AddAlias("D0", "Delta0");
105  AddAlias("D+", "Delta+");
106  AddAlias("D++", "Delta++");
107  AddAlias("D-", "Delta-");
108  AddAlias("D0", "Delta(1232)0");
109  AddAlias("D+", "Delta(1232)+");
110  AddAlias("D++", "Delta(1232)++");
111  AddAlias("D-", "Delta(1232)-");
112 
113 
114  AddAlias("DP330", "Delta(1600)0");
115  AddAlias("DP33+", "Delta(1600)+");
116  AddAlias("DP33++", "Delta(1600)++");
117  AddAlias("DP33-", "Delta(1600)-");
118 
119  AddAlias("DS310", "Delta(1620)0");
120  AddAlias("DS31+", "Delta(1620)+");
121  AddAlias("DS31++", "Delta(1620)++");
122  AddAlias("DS31-", "Delta(1620)-");
123 
124  AddAlias("NP11+", "N*(1440)+");
125  AddAlias("NP110", "N*(1440)0");
126  AddAlias("ND13+", "N*(1520)+");
127  AddAlias("ND130", "N*(1520)0");
128  AddAlias("NS11+", "N*(1535)+");
129  AddAlias("NS110", "N*(1535)0");
130 
131  //Ingo's additions:
132  makeDataBase()->SetParamDouble("D+", "lmass", 1.);
133  //--> lmass=0 leads to endless loop in PHadronDecayM1:: maxBWWeight
134  makeDataBase()->SetParamDouble("D+", "umass", 3.);
135 
136  system_alloc_verbosity = GetBatchValue("_system_alloc_verbosity");
137  (*system_alloc_verbosity) = 1.;
138 
139  *GetBatchValue("_system_weight_version") = 1.;
140  *GetBatchValue("_system_unstable_width") = 0.0001;
141 
142  *GetBatchValue("_event_plane") = 0.;
143  *GetBatchValue("_event_impact_param") = 0.;
144  *GetBatchValue("_event_vertex_x") = 0.;
145  *GetBatchValue("_event_vertex_y") = 0.;
146  *GetBatchValue("_event_vertex_z") = 0.;
147  *GetBatchValue("_event_seqnr") = -1.;
148 
149 
150  /*
151  Double_t *version= GetBatchValue("_system_version");
152 
153  if (!strncmp("CVS",version_string,3)) {
154  (*version)=999.;
155  } else {
156  sscanf(version_string,"%lf",version);
157  }
158 */
159 }
160 
161 
162 int PStaticData::MakeDirectoryEntry(const char* name,
163  const char* n,
164  const char* l,
165  const char* ename) {
166  // Adds an entry of the form "dir"
167  // if entry/dir is existing, the key w/o warning is returned
168  // n and l are the data base columns of the list
169 
170  Int_t skey = -1;
171 
172  if (makeDataBase()->GetParamInt(n) < 0)
173  makeDataBase()->MakeParamInt(n, "number of links");
174  if (makeDataBase()->GetParamInt(l) < 0)
175  makeDataBase()->MakeParamInt(l, "links");
176 
177  skey = makeDataBase()->GetEntry(name);
178  if (skey < 0) skey = makeDataBase()->AddEntry(name);
179  if (skey < 0) return -1; //failed
180 
181  skey = makeDataBase()->GetEntry(ename);
182  if (skey < 0) skey = makeDataBase()->AddEntry(ename);
183  if (skey < 0) return -1; //failed
184 
185  Int_t* dummy;
186  if (!makeDataBase()->GetParamInt(skey, l, &dummy)) {
187  //fresh entry
188  skey = makeDataBase()->AddListEntry(name, n, l, ename);
189  }
190  return skey;
191 }
192 
193 
194 Double_t* PStaticData::GetBatchValue(const char* name, Int_t make_val) {
195  Int_t key_a =
196  MakeDirectoryEntry("batch_objects", NBATCH_NAME, LBATCH_NAME, name);
197  //Check if double is existing
198  Double_t* val;
199  Int_t batch_value_param = makeDataBase()->GetParamDouble("batch_value");
200  if (batch_value_param < 0)
201  batch_value_param = makeDataBase()->MakeParamDouble(
202  "batch_value", "Double storage for batch");
203  //cout << key_a << ":" << makeDataBase()->GetParamDouble(key_a ,batch_value_param,&val) << endl;
204  if (!makeDataBase()->GetParamDouble(key_a, batch_value_param, &val)) {
205  if (make_val) {
206  Double_t* delme = new Double_t(0.);
207  makeDataBase()->SetParamDouble(key_a, "batch_value", delme);
208  return delme;
209  } else
210  return nullptr;
211  }
212  return val;
213 };
214 
215 
216 int PStaticData::GetParticleID(const char* id, int warn) {
217  // pid by name
218  if (!id) return 0;
219  if (!makeDataBase()->GetParamInt(
220  makeDataBase()->GetEntry((char*) id), pid_param, &i_result)) {
221  Int_t key = GetAliasParent(id);
222  if (key < 0) {
223  if (warn) { Warning("GetParticleID", "%s not found", id); }
224  return 0;
225  }
226  return GetParticleIDByKey(key);
227  }
228  return *i_result;
229 };
230 
231 const char* PStaticData::GetParticleName(const int& id) {
232  // name by pid
233  Int_t key = -1;
234  if ((key = makeDataBase()->GetEntryInt(pid_param, id)) < 0) {
235  Warning("GetParticleName", "id %i not found", id);
236  return "";
237  }
239  return c_result;
240 };
241 
243  // pid by key
244  // -1 if unvalid
245  if (!makeDataBase()->GetParamInt(key, pid_param, &i_result)) return -1;
246  return *i_result;
247 }
248 
249 int PStaticData::GetParticleKey(const int& id) {
250  // data base key by pid
251  Int_t key = -1;
252  if ((key = makeDataBase()->GetEntryInt(pid_param, id)) < 0) {
253  Warning("GetParticleKey", "id %i not found", id);
254  }
255  return key;
256 }
257 
258 int PStaticData::GetDecayKey(const int& id) {
259  // data base key by pid
260  Int_t key = -1;
261  if ((key = makeDataBase()->GetEntryInt(didx_param, id)) < 0) {
262  Warning("GetDecayKey", "id %i not found", id);
263  }
264  return key;
265 }
266 
267 int PStaticData::IsParticle(const int& id, const char* name) {
268  // does pid correspond to given name?
269  if (strcmp(name, GetParticleName(id)) == 0) return 1;
270  return 0;
271 };
272 
273 int PStaticData::IsParticleValid(const int& id) {
274  // check id range by id
275  // Returns a "1" in any case if data base is filled with id
276  // PFireball particles return 0;
277 
278  Int_t key = -1;
279  if ((key = makeDataBase()->GetEntryInt(pid_param, id)) >= 0) {
280  return id; //if in data base in any case say yes
281  }
282 
283  if ((id > 500) && (id < 1000)) return id;
284 
285  return 0;
286 }
287 
288 int PStaticData::IsParticleValid(const char* n) {
289  // check id range by name
290 
291  if (!n) return 0;
292  int pid = GetParticleID(n, 0);
293  if (pid < 0) return 0;
294 
295  return IsParticleValid(pid);
296 }
297 
298 int PStaticData::AddAlias(const char* old_name, const char* new_name) {
299  //adds an alias to primary_key, ret value is alias key
300  PDataBase* base = makeDataBase();
301  Int_t pkey = -1;
302 
303  if ((pkey = base->AddListEntry(old_name, "nalias", "lalias", new_name)) < 0) {
304  Warning("AddAlias", "Name %s not found", old_name);
305  return -1;
306  }
307 
308  return pkey;
309 }
310 
311 int PStaticData::GetAliasParent(const char* alias_name) {
312  Int_t listkey = -1, *dummy;
313  Int_t key = makeDataBase()->GetEntry(alias_name);
314  if (key < 0) return -1;
315  while (makeDataBase()->MakeListIterator(key, -1, lalias_param, &listkey)) {
316  if (makeDataBase()->GetParamInt(listkey, nalias_param, &dummy)) {
317  //count found
318  return listkey;
319  }
320  }
321  return -1;
322 }
323 
325  Int_t listkey = -1, *dummy;
326  if (key < 0) return -1;
327  if (!makeDataBase()->GetParamInt(key, lalias_param, &dummy)) return -1;
328  while (makeDataBase()->MakeListIterator(key, -1, lalias_param, &listkey)) {
329  if (makeDataBase()->GetParamInt(listkey, nalias_param, &dummy)) {
330  //count found
331  return listkey;
332  }
333  }
334  return -1;
335 }
336 
337 int PStaticData::GetSecondaryKey(int key, int defkey) {
338  Int_t listkey = -1;
339 
340  Int_t* dummy;
341  if (!makeDataBase()->GetParamInt(key, nalias_param, &dummy)) {
342  //Warning("MakeListIterator","count %s not found",count);
343  //try to find parent
344  //cout << "orig key=" << key;
345  key = GetAliasParent(key);
346  //cout << " now: " << key << endl;
347  if (key < 0) return -1; //avoid messages
348  }
349 
350  while (makeDataBase()->MakeListIterator(
351  key, nalias_param, lalias_param, &listkey)) {
352 
353  //cout << "listkey " << listkey << endl;
354 
355  //loop over all secondaries
356  if (makeDataBase()->GetParamInt(listkey, defkey_param, &dummy)) {
357  if (*dummy == defkey) return listkey;
358  }
359  }
360  return -1;
361 }
362 
363 
364 int PStaticData::AddParticle(int pid, const char* name, double mass) {
365  clearFreezeOut();
366  PDataBase* base = makeDataBase();
367  Int_t pkey = -1;
368 
369  //check if pid already exists
370  if (pid >= 0)
371  if (base->GetEntryInt("pid", pid) >= 0) {
372  Warning("AddParticle", "pid %i already used in data base", pid);
373  return -1;
374  }
375 
376  if (base->GetEntry(name) >= 0) {
377  Warning("AddParticle", "Name %s already used in data base", name);
378  return -1;
379  }
380 
381  if (pid < 0) {
382  pid = 0;
383  while (makeDataBase()->GetEntryInt("pid", pid) >= 0) {
384  pid++;
385  }
387  Info("AddParticle", "(%s) PID: %i", PRINT_AUTO_ALLOC, pid);
388  }
389 
390  if ((pkey = base->AddListEntry("std_set", "snpart", "slink", name)) < 0) {
391  Warning("AddParticle", "particle header not found");
392  return -1;
393  }
394 
395  Int_t* ii = new int(pid); //never destructed, but called only once!
396  if (!base->SetParamInt(pkey, "pid", ii)) {
397  delete ii;
398  return -1;
399  }
400  Double_t* dd = new double(0.);
401  if (!base->SetParamDouble(pkey, "width", dd)) {
402  delete dd;
403  return -1;
404  }
405  dd = new Double_t(mass);
406  if (!base->SetParamDouble(pkey, "mass", dd)) {
407  delete dd;
408  return -1;
409  }
410  dd = new Double_t(mass);
411  if (!base->SetParamDouble(pkey, "ethreshold", dd)) {
412  delete dd;
413  return -1;
414  }
415  ii = new int(0);
416  if (!base->SetParamInt(pkey, "meson", ii)) return -1;
417  ii = new int(0);
418  if (!base->SetParamInt(pkey, "baryon", ii)) return -1;
419  ii = new int(0); //Meson by default: No limitation in LMass
420  if (!base->SetParamInt(pkey, "lepton", ii)) return -1;
421  ii = new int(0);
422  if (!base->SetParamInt(pkey, "charge", ii)) return -1;
423  ii = new int(0);
424  if (!base->SetParamInt(pkey, "spin", ii)) return -1;
425  ii = new int(0);
426  if (!base->SetParamInt(pkey, "parity", ii)) return -1;
427  ii = new int(0);
428  if (!base->SetParamInt(pkey, "ispin", ii)) return -1;
429  ii = new int(0);
430  if (!base->SetParamInt(pkey, "pythiakf", ii)) return -1;
431  ii = new int(0);
432  if (!base->SetParamInt(pkey, "widx", ii)) return -1;
433  ii = new int(0);
434  if (!base->SetParamInt(pkey, "tdepth", ii)) return -1;
435  ii = new int(0);
436  if (!base->SetParamInt(pkey, "hdepth", ii)) return -1;
437  return pid;
438 }
439 
440 
442  return PrintParticleByKey(makeDataBase()->GetEntryInt("pid", pid));
443 };
444 
445 
447  makeDataBase()->ListEntries(key, 0, "name,pid,width,mass");
448 
449  Int_t listkey = -1, alias_printed = 0;
450  Int_t* dummy;
451  if (makeDataBase()->GetParamInt(key, nalias_param, &dummy)) {
452  while (
453  makeDataBase()->MakeListIterator(key, "nalias", "lalias", &listkey)) {
454  alias_printed = 1;
455  cout << "Alias: " << makeDataBase()->GetName(listkey) << endl;
456  ;
457  }
458  }
459  if (alias_printed) cout << endl;
460 
461  if (!GetParticleNChannelsByKey(key)) {
462  cout << "This particle is stable" << endl;
463  return;
464  }
465 
466  cout << "This particle decays via the following modes:" << endl;
467 
468  //now loop over decay modes
469  listkey = -1;
470 
471  while (makeDataBase()->MakeListIterator(key, "pnmodes", "link", &listkey)) {
472  PrintDecayByKey(listkey);
473  }
474 };
475 
476 int PStaticData::GetParticleKF(const int id) {
477  // return Pythia6 kf code
478  if (!id) return 0;
479  if (!makeDataBase()->GetParamInt(pid_param, id, pkf_param, &i_result)) {
480  Warning("GetParticleKF", "id %i not found", id);
481  return 0;
482  }
483  return *i_result;
484 }
485 
487  // return Id corresponding to Pythia6 kf code
488  if (!kf) return 0;
489  int* id = nullptr;
490  int key;
491 
492  if ((key = makeDataBase()->GetEntryInt(pkf_param, kf)) < 0) {
493  Warning("GetParticleIDbyKF", "invalid kf code %i", *id);
494  return 0;
495  }
496  if (!makeDataBase()->GetParamInt(key, pid_param, &id)) return 0;
497  return *id;
498 }
499 
500 
501 int PStaticData::IsParticleMeson(const int& id) {
502  // is meson?, by pid
503  if (!id) return 0;
504  if (!makeDataBase()->GetParamInt(pid_param, id, meson_param, &i_result)) {
505  // if not found obviously not a meson
506  return 0;
507  }
508  return *i_result;
509 };
510 
511 int PStaticData::IsParticleHadron(const int& id) {
512  // is hadron?, by pid
513  if (IsParticleMeson(id) || GetParticleBaryon(id)) return 1;
514  return 0;
515 };
516 
517 int PStaticData::GetParticleBaryon(const int& id) {
518  // baryon number by pid
519  if (!makeDataBase()->GetParamInt(pid_param, id, baryon_param, &i_result)) {
520  // if not found obviously not a baryon
521  return 0;
522  }
523  return *i_result;
524 };
525 
526 void PStaticData::SetParticleBaryon(const char* id, Int_t num) {
527  // baryon number by name
528  if (!makeDataBase()->GetParamInt(
529  pid_param, GetParticleID((char*) id), baryon_param, &i_result)) {
530  // if not found, set param
531  makeDataBase()->SetParamInt((char*) id, "baryon", num);
532  }
533  *i_result = num;
534 }
535 
536 void PStaticData::SetParticleMeson(const char* id, Int_t num) {
537  // set meson number
538  if (!makeDataBase()->GetParamInt(
539  pid_param, GetParticleID((char*) id), meson_param, &i_result)) {
540  // if not found, set param
541  makeDataBase()->SetParamInt((char*) id, "meson", num);
542  }
543  *i_result = num;
544 }
545 
546 void PStaticData::SetParticleLepton(const char* id, Int_t num) {
547  if (!makeDataBase()->GetParamInt(
548  pid_param, GetParticleID((char*) id), lepton_param, &i_result)) {
549  // if not found, set param
550  makeDataBase()->SetParamInt((char*) id, "lepton", num);
551  }
552  *i_result = num;
553 }
554 
555 void PStaticData::SetParticleCharge(const char* id, Int_t charge) {
556  if (!makeDataBase()->GetParamInt(
557  pid_param, GetParticleID((char*) id), charge_param, &i_result)) {
558  // if not found, set param
559  makeDataBase()->SetParamInt((char*) id, "charge", charge);
560  }
561  *i_result = charge;
562 }
563 
564 void PStaticData::SetParticleSpin(const char* id, Int_t spin) {
565  if (!makeDataBase()->GetParamInt(
566  pid_param, GetParticleID((char*) id), spin_param, &i_result)) {
567  // if not found, set param
568  makeDataBase()->SetParamInt((char*) id, "spin", spin);
569  }
570  *i_result = spin;
571 }
572 
573 void PStaticData::SetParticleIsospin(const char* id, Int_t isospin) {
574  if (!makeDataBase()->GetParamInt(
575  pid_param, GetParticleID((char*) id), ispin_param, &i_result)) {
576  // if not found, set param
577  makeDataBase()->SetParamInt((char*) id, "ispin", isospin);
578  }
579  *i_result = isospin;
580 }
581 
582 void PStaticData::SetParticleParity(const char* id, Int_t parity) {
583  if (!makeDataBase()->GetParamInt(
584  pid_param, GetParticleID((char*) id), parity_param, &i_result)) {
585  // if not found, set param
586  makeDataBase()->SetParamInt((char*) id, "parity", parity);
587  }
588  *i_result = parity;
589 }
590 
591 int PStaticData::GetParticleLepton(const int& id) {
592  // lepton number by pid
593  if (!makeDataBase()->GetParamInt(pid_param, id, lepton_param, &i_result)) {
594  // if not found obviously not a lepton
595  return 0;
596  }
597  return *i_result;
598 };
599 
600 int PStaticData::GetParticleCharge(const int& id) {
601  // charge by pid
602  if (!makeDataBase()->GetParamInt(pid_param, id, charge_param, &i_result)) {
603  cout << "PStaticData::Charge: " << id << " not found" << endl;
604  return 0;
605  }
606  return *i_result;
607 };
608 
609 int PStaticData::GetParticleCharge(const char* id) {
610  // charge by name
611  if (!makeDataBase()->GetParamInt(
613  cout << "PStaticData::Charge: " << id << " not found" << endl;
614  return 0;
615  }
616  return *i_result;
617 };
618 
619 int PStaticData::GetParticleSpin(const int& id) {
620  // 2 x J by pid
621  if (!makeDataBase()->GetParamInt(pid_param, id, spin_param, &i_result)) {
622  cout << "PStaticData::GetParticleSpin: " << id << " not found" << endl;
623  return 0;
624  }
625  return *i_result;
626 };
627 
628 int PStaticData::GetParticleSpin(const char* id) {
629  // 2 x J by name
630  if (!makeDataBase()->GetParamInt(
632  cout << "PStaticData::GetParticleSpin: " << id << " not found" << endl;
633  return 0;
634  }
635  return *i_result;
636 };
637 
639  // 2 x I by pid
640  if (!makeDataBase()->GetParamInt(pid_param, id, ispin_param, &i_result)) {
641  cout << "PStaticData::GetParticleIsospin: " << id << " not found" << endl;
642  return 0;
643  }
644  return *i_result;
645 };
646 
647 int PStaticData::GetParticleIsospin(const char* id) {
648  // 2 x I by name
649  if (!makeDataBase()->GetParamInt(
651  cout << "PStaticData::GetParticleIsospin: " << id << " not found" << endl;
652  return 0;
653  }
654  return *i_result;
655 };
656 
657 int PStaticData::GetParticleParity(const int& id) {
658  // parity (0 if irrelevant)
659  if (!makeDataBase()->GetParamInt(pid_param, id, parity_param, &i_result)) {
660  cout << "PStaticData::GetParticleParity: " << id << " not found" << endl;
661  return 0;
662  }
663  return *i_result;
664 };
665 
666 int PStaticData::GetParticleParity(const char* id) {
667  // parity (0 if irrelevant)
668  if (!makeDataBase()->GetParamInt(
670  cout << "PStaticData::GetParticleParity: " << id << " not found" << endl;
671  return 0;
672  }
673  return *i_result;
674 };
675 
676 double PStaticData::GetParticleMass(const int& id) {
677  // mass by id
678 
679  if (!makeDataBase()->GetParamDouble(pid_param, id, mass_param, &d_result)) {
680  cout << "PStaticData::GetParticleMass: " << id << " not found" << endl;
681  return 0;
682  }
683  return *d_result;
684 };
685 
686 double PStaticData::GetParticleMass(const char* id) {
687  // mass by name
688  if (!makeDataBase()->GetParamDouble(
690  cout << "PStaticData::GetParticleMass: " << id << " not found" << endl;
691  return 0;
692  }
693  return *d_result;
694 };
695 
696 double PStaticData::GetParticleMassByKey(const int& id) {
697  // mass by key
698  if (!makeDataBase()->GetParamDouble(id, mass_param, &d_result)) {
699  cout << "PStaticData::GetParticleMassByKey: " << id << " not found" << endl;
700  return 0;
701  }
702  return *d_result;
703 };
704 
705 void PStaticData::SetParticleMass(Int_t id, Float_t mass) {
706  //reset mass
707  if (!makeDataBase()->GetParamDouble(pid_param, id, mass_param, &d_result)) {
708  cout << "PStaticData::SetParticleMass: " << id << " not found" << endl;
709  }
710  *d_result = mass;
711 }
712 
713 void PStaticData::SetParticleMass(const char* id, Float_t mass) {
714  //reset mass
715  if (!makeDataBase()->GetParamDouble(
717  cout << "PStaticData::SetParticleMass: " << id << " not found" << endl;
718  }
719  *d_result = mass;
720 }
721 
722 
723 const char* PStaticData::GetDecayName(Int_t id) {
724  if (!makeDataBase()->GetParamString(didx_param, id, name_param, &c_result)) {
725  return "NONAME";
726  }
727  return c_result;
728 }
729 
730 const char* PStaticData::GetDecayNameByKey(Int_t key) {
731  if (!makeDataBase()->GetParamString(key, name_param, &c_result)) {
732  return "NONAME";
733  }
734  return c_result;
735 }
736 
738  Float_t wid) { // set new total width
739  if (!makeDataBase()->GetParamDouble(
741  cout << "PStaticData::SetTWidth: " << id << " not found" << endl;
742  }
743  *d_result = wid;
744 
745  SetParticleEmin(GetParticleID(id), GetParticleMass(id) - 2 * wid);
746 
747  //TODO
748  // Int_t n=PNModes[id], p0=GetPosition(id), p;
749  // for (p=p0; p<p0+n; ++p) if (PWidx[p]!=-1) PWidx[p]=0;
750  // TWidx[id]=0;
751  //printf("\n*** Warning: Use only at start of macro! ***\n\n");
752 }
753 
755  Float_t wid) { // set new total width
756  if (!makeDataBase()->GetParamDouble(pid_param, id, width_param, &d_result)) {
757  cout << "PStaticData::SetTWidth: " << id << " not found" << endl;
758  }
759  *d_result = wid;
760  //TODO
761  // Int_t n=PNModes[id], p0=GetPosition(id), p;
762  // for (p=p0; p<p0+n; ++p) if (PWidx[p]!=-1) PWidx[p]=0;
763  // TWidx[id]=0;
764  printf("\n*** Warning: Use only at start of macro! ***\n\n");
765 }
766 
767 
768 int PStaticData::GetTWidx(const int& id) {
769  // width flag from index
770  // 0: static width only
771  // 1: use dynamic width
772  //-1: Disabled
773  if (!makeDataBase()->GetParamInt(pid_param, id, widx_param, &i_result)) {
774  cout << "PStaticData::GetTWidx: " << id << " not found" << endl;
775  return 0;
776  }
777 
778  return *i_result;
779 }
780 
781 int PStaticData::GetPWidx(const int& id) {
782  // width flag from index
783  // 0: static width only
784  // 1: use dynamic width
785  //-1: Disabled
786  if (!makeDataBase()->GetParamInt(didx_param, id, widx_param, &i_result)) {
787  cout << "PStaticData::GetPWidx: " << id << " not found" << endl;
788  return 0;
789  }
790  return *i_result;
791 }
792 
793 void PStaticData::SetTWidx(const int& id, const int& v) {
794  // width flag from index
795  // 0: static width only
796  // 1: use dynamic width
797 
798  if (!makeDataBase()->GetParamInt(pid_param, id, widx_param, &i_result)) {
799  cout << "PStaticData::SetTWidx: " << id << " not found" << endl;
800  }
801  *i_result = v;
802 }
803 
804 void PStaticData::SetPWidx(const int& id, const int& v) {
805  // width flag from index
806  // 0: static width only
807  // 1: use dynamic width
808 
809  if (!makeDataBase()->GetParamInt(didx_param, id, widx_param, &i_result)) {
810  cout << "PStaticData::GetPWidx: " << id << " not found" << endl;
811  }
812  *i_result = v;
813 }
814 
815 void PStaticData::SetTWidthMesh(const int& id, PMesh* mesh) {
816 
817  Int_t key = makeDataBase()->GetEntryInt("pid", id);
818  if (!makeDataBase()->SetParamTObj(key, "mesh", mesh)) {
819  cout << "PStaticData::SetTWidx: " << id << " not possible" << endl;
820  }
821 };
822 
823 
825  if (!makeDataBase()->GetParamTObj(pid_param, id, mesh_param, &t_result)) {
826  cout << "PStaticData::GetTWidthMesh: " << id << " not found" << endl;
827  return nullptr;
828  }
829  return (PMesh*) t_result;
830 };
831 
832 void PStaticData::SetPWidthMesh(const int& id, PMesh* mesh) {
833  Int_t key = makeDataBase()->GetEntryInt("didx", id);
834  if (!makeDataBase()->SetParamTObj(key, "mesh", mesh)) {
835  cout << "PStaticData::SetPWidthMesh: " << id << " not possible" << endl;
836  }
837 };
838 
839 
841  if (!makeDataBase()->GetParamTObj(didx_param, id, mesh_param, &t_result)) {
842  cout << "PStaticData::GetPWidthMesh: " << id << " not found" << endl;
843  return nullptr;
844  }
845  return (PMesh*) t_result;
846 };
847 
848 
849 void PStaticData::SetTF1(const int& id, TF1* mesh) {
850  Int_t key = makeDataBase()->GetEntryInt("pid", id);
851  if (!makeDataBase()->SetParamTObj(key, "tf1", mesh)) {
852  cout << "PStaticData::SetTF1: " << id << " not possible" << endl;
853  }
854 };
855 
856 
857 TF1* PStaticData::GetTF1(const int& id) {
858  if (!makeDataBase()->GetParamTObj(pid_param, id, tf1_param, &t_result)) {
859  // cout << "PStaticData::GetTF1: " << id << " not found" << endl;
860  return nullptr;
861  }
862  return (TF1*) t_result;
863 };
864 
865 
866 Double_t PStaticData::GetDecayEmin(const int& id) {
867  if (!makeDataBase()->GetParamDouble(
869  cout << "PStaticData::GetDecayEmin: " << id << " not found" << endl;
870  return 0;
871  }
872  return *d_result;
873 }
874 
876  if (!makeDataBase()->GetParamInt(didx_param, didx, brflag_param, &i_result)) {
877  return 0;
878  }
879  return *i_result;
880 }
881 
882 void PStaticData::SetDecayBRFlag(int didx, int flag) {
883  //Set the BR flag for the "didx", thus the total normalization
884  //is used (when flag=1) instead of the pole mass
885  if (!makeDataBase()->GetParamInt(didx_param, didx, brflag_param, &i_result)) {
886  Int_t* ii = new Int_t(flag);
887  if (!makeDataBase()->SetParamInt(GetDecayKey(didx), "brflag", ii)) {
888  delete ii;
889  return;
890  }
891  } else {
892  *i_result = flag;
893  }
894 }
895 
896 void PStaticData::SetTotalNormalization(char* p, int flag) {
897  //Wrapper function which enables the total normalization
898  //for a particle "p"
899  Int_t listkey = -1;
900  Int_t key = GetParticleKey(p);
901  if (key < 0) {
902  Warning("SetTotalNormalization", "Invalid particle");
903  return;
904  }
905 
906  while (makeDataBase()->MakeListIterator(key, "pnmodes", "link", &listkey)) {
907  if (!makeDataBase()->GetParamInt(listkey, brflag_param, &i_result)) {
908  Int_t* ii = new Int_t(flag);
909  if (!makeDataBase()->SetParamInt(listkey, "brflag", ii)) {
910  delete ii;
911  return;
912  }
913  } else {
914  *i_result = flag;
915  }
916  }
917 }
918 
919 void PStaticData::SetDecayEmin(const int& id, const double v) {
920  if (!makeDataBase()->GetParamDouble(
922  cout << "PStaticData::SetDecayEmin: " << id << " not found" << endl;
923  }
924  *d_result = v;
925 }
926 
927 Double_t PStaticData::GetParticleEmin(const int& id) {
928  if (!makeDataBase()->GetParamDouble(
930  cout << "PStaticData::GetParticleEmin: " << id << " not found" << endl;
931  return 0;
932  }
933  return *d_result;
934 }
935 
936 void PStaticData::SetParticleEmin(const int& id, const double v) {
937  if (!makeDataBase()->GetParamDouble(
939  cout << "PStaticData::SetParticleEmin: " << id << " not found" << endl;
940  }
941  *d_result = v;
942 }
943 
944 Double_t PStaticData::GetParticleLMass(const int& id) {
945  if (!makeDataBase()->GetParamDouble(pid_param, id, lmass_param, &d_result)) {
946  Warning("GetParticleLMass", "id %i not found", id);
947  return 0;
948  }
949  return *d_result;
950 }
951 
952 void PStaticData::SetParticleLMass(const char* id, const double v) {
953  if (!makeDataBase()->GetParamDouble(
954  pid_param, GetParticleID((char*) id), lmass_param, &d_result)) {
955  // if not found, set param
956  makeDataBase()->SetParamDouble((char*) id, "lmass", v);
957  return;
958  }
959  *d_result = v;
960 }
961 
962 Double_t PStaticData::GetParticleUMass(const int& id) {
963  if (!makeDataBase()->GetParamDouble(pid_param, id, umass_param, &d_result)) {
964  Warning("GetParticleUMass", "id %i not found", id);
965  return 0;
966  }
967  return *d_result;
968 }
969 
970 void PStaticData::SetParticleUMass(const char* id, const double v) {
971  if (!makeDataBase()->GetParamDouble(
972  pid_param, GetParticleID((char*) id), umass_param, &d_result)) {
973  // if not found, set param
974  makeDataBase()->SetParamDouble((char*) id, "umass", v);
975  return;
976  }
977  *d_result = v;
978 }
979 
980 int PStaticData::GetTDepth(const int& id) {
981  if (!makeDataBase()->GetParamInt(pid_param, id, tdepth_param, &i_result)) {
982  cout << "PStaticData::GetTDepth: " << id << " not found" << endl;
983  return 0;
984  }
985  return *i_result;
986 }
987 
988 void PStaticData::SetTDepth(const int& id, const int& depth) {
989  if (!makeDataBase()->GetParamInt(pid_param, id, tdepth_param, &i_result)) {
990  cout << "PStaticData::GetTDepth: " << id << " not found" << endl;
991  }
992  *i_result = depth;
993 }
994 
995 int PStaticData::GetHDepth(const int& id) {
996  if (!makeDataBase()->GetParamInt(pid_param, id, hdepth_param, &i_result)) {
997  cout << "PStaticData::GetHDepth: " << id << " not found" << endl;
998  return 0;
999  }
1000  return *i_result;
1001 }
1002 
1003 void PStaticData::SetHDepth(const int& id, const int& depth) {
1004  if (!makeDataBase()->GetParamInt(pid_param, id, hdepth_param, &i_result)) {
1005  cout << "PStaticData::GetHDepth: " << id << " not found" << endl;
1006  }
1007  *i_result = depth;
1008 }
1009 
1010 Double_t PStaticData::GetDecayBR(Int_t id) {
1011  if (!makeDataBase()->GetParamDouble(didx_param, id, br_param, &d_result)) {
1012  cout << "PStaticData::GetDecayBR: " << id << " not found" << endl;
1013  }
1014  return *d_result;
1015 };
1016 
1018  double res = GetDecayBR(id) * GetParticleTotalWidth(GetDecayParent(id));
1019  return res;
1020 };
1021 
1023  double res = GetDecayBR(id) * GetParticleTotalWidth(GetDecayParentByKey(id));
1024  return res;
1025 };
1026 
1027 
1028 bool PStaticData::SetDecayBR(int didx, double br, int mode) {
1029  //Mode: see SetDecayBR(const char *parent, const char * daughters)
1030 
1031  clearFreezeOut();
1032  Int_t key = GetDecayKey(didx);
1033  Double_t* brorig;
1034  if (!makeDataBase()->GetParamDouble(key, "brorig", &brorig)) return kFALSE;
1035 
1036  if (mode) {
1037  Double_t other = 1. - GetDecayBR(didx);
1038  br = (other * br) / (1. - br);
1039  }
1040 
1041  *brorig = br;
1042 
1044 }
1045 
1046 bool PStaticData::SetDecayBRByKey(int key, double br, int mode) {
1047  //Mode: see SetDecayBR(const char *parent, const char * daughters)
1048  clearFreezeOut();
1049  Double_t* brorig;
1050  if (!makeDataBase()->GetParamDouble(key, "brorig", &brorig)) return kFALSE;
1051 
1052  if (mode) {
1053  Double_t other = 1. - GetDecayBR(GetDecayIdxByKey(key));
1054  br = (other * br) / (1. - br);
1055  }
1056 
1057  *brorig = br;
1059 }
1060 
1061 bool PStaticData::SetDecayBR(const char* parent,
1062  const char* daughters,
1063  double br,
1064  int mode) {
1065  // Resets the decay branching ratio of an existing decay
1066  // Handle this functon with care!
1067  // Do not use this function to change the weighting etc.
1068  // because the change of the decay b.r. will affect the
1069  // shape of the parent resonance
1070  //
1071  // If you have really physics arguments to change the b.r.
1072  // (e.g. update of PDG values)
1073  // you *must* use this function at the very beginning of your macro,
1074  // but at least before the "GetWidth" is called
1075  //
1076  // Mode flag:
1077  // 0: Add the new b.r. to the existing ones + re-weighting
1078  // 1: No re-weighting (in this case br must be <1.)
1079 
1080 
1081  //get parent key
1082  Int_t parent_key = makeDataBase()->GetEntry(parent);
1083  if (parent_key < 0) {
1084  cout << "PStaticData::SetDecayBR: parent " << parent
1085  << " not found in data base" << endl;
1086  return kFALSE;
1087  }
1088 
1089  Int_t pid = GetParticleIDByKey(parent_key);
1090  if (pid < 0) { return kFALSE; }
1091 
1092  //now check the daughters
1093  //TODO: All this should go into a help function
1094  char* arr1[7];
1095  Int_t arr1_s = 7; //max 7 decay products
1096 
1097  Tokenize(daughters, ",", arr1, &arr1_s);
1098 
1099  Int_t pids[8];
1100  pids[0] = pid;
1101  for (int pat = 0; pat < arr1_s; pat++) {
1102  pids[pat + 1] = GetParticleID(arr1[pat]);
1103  //cout << pids[pat+1]<<endl;
1104  }
1105 
1106  Int_t decay_key = GetDecayKey(pids, arr1_s);
1107 
1108  if (decay_key < 0) {
1109  Warning("SetDecayBR", "Decay %s -> %s not defined", parent, daughters);
1110  return kFALSE;
1111  }
1112 
1113  return SetDecayBRByKey(decay_key, br, mode);
1114 }
1115 
1116 
1117 // This was the old Kagarlis method:
1118 // if (brn<1 || brn>PNModes[id]) return;
1119 // Int_t pos = GetPosition(id);
1120 // if (pos!=-1) {
1121 // Int_t idx = pos+brn-1;
1122 // PBR[idx] = br;
1123 // if (freeze) {
1124 // PWidx[idx] = -1; // Set BR flag to static
1125 // printf("Branch %3i set static to %f\n",idx,br);
1126 // }
1127 // printf("\n*** Warning: Use only at start of macro! ***\n\n");
1128 // }
1129 //}
1130 
1132  // normalize branching ratios for particle id
1133  //TODO: check if this works
1134  Int_t key = makeDataBase()->GetEntryInt(pid_param, id);
1135  return NormParticleBRbyKey(key);
1136 }
1137 
1139  // normalize branching ratios for particle id
1140 
1141  Int_t listkey = -1;
1142  double sum = 0.;
1143  Double_t *br, *brorig, *width;
1144  Double_t twidth = GetParticleTotalWidthByKey(key);
1145 
1146  if (GetParticleNChannelsByKey(key) == 0) return kFALSE;
1147 
1148  while (makeDataBase()->MakeListIterator(key, "pnmodes", "link", &listkey)) {
1149  if (!makeDataBase()->GetParamDouble(listkey, "brorig", &brorig))
1150  return kFALSE;
1151  sum += *brorig;
1152  }
1153 
1154  listkey = -1;
1155  if (sum > 0.)
1156  while (makeDataBase()->MakeListIterator(key, "pnmodes", "link", &listkey)) {
1157  if (!makeDataBase()->GetParamDouble(listkey, "brorig", &brorig))
1158  return kFALSE;
1159  if (!makeDataBase()->GetParamDouble(listkey, "br", &br)) return kFALSE;
1160  *br = *brorig / sum;
1161  if (makeDataBase()->GetParamDouble(listkey, "width", &width)) {
1162  *width = *br * twidth;
1163  }
1164  }
1165  return kTRUE;
1166 }
1167 
1168 
1169 void PStaticData::FreezeDecayBR(Int_t /*id*/, Int_t /*brn*/) { // set BR static
1170  Fatal("FreezeDecayBR", "not implemented");
1171 
1172  //TODO
1173  // Int_t pos = GetPosition(id);
1174  // if (pos!=-1) {
1175  // Int_t idx = pos+brn-1;
1176  // PWidx[idx] = -1;
1177  // printf("Branch %3i set static\n",idx);
1178  // printf("\n*** Warning: Use only at start of macro! ***\n\n");
1179  // }
1180 }
1181 
1183  // number of decay channels by pid
1184  if (!makeDataBase()->GetParamInt(pid_param, id, pnmodes_param, &i_result)) {
1185  // if not found obviously no decay
1186  return 0;
1187  }
1188  return *i_result;
1189 };
1190 
1192  // number of decay channels by name
1193  if (!makeDataBase()->GetParamInt((char*) id, "pnmodes", &i_result)) {
1194  return 0;
1195  }
1196  return *i_result;
1197 };
1198 
1200  // number of decay channels by key
1201  if (!makeDataBase()->GetParamInt(key, "pnmodes", &i_result)) { return 0; }
1202  return *i_result;
1203 };
1204 
1206  Int_t tid[11];
1207  tid[0] = 10;
1208 
1209  GetDecayMode(didx, tid);
1210  for (int i = 1; i < tid[0]; i++) {
1211  // cout << didx << ":" << IsParticleHadron(tid[1]) << endl;
1212  if (!IsParticleHadron(tid[1])) return 0;
1213  }
1214  return 1;
1215 }
1216 
1248 /*
1249 int PStaticData::AddDecay(int didx, const char * name, const char *parent,
1250  const char * daughters , double br) {
1251  //make new decay with decay index "didx"
1252  //the didx should be a free number (or set to -1 for auto-alloc)
1253  //parent particle is "parent", which must be existing
1254  //"name" is the new unique string identifier of the decay
1255  //daughers is an particle array of the format "p1,p2,p3,..."
1256  //br is the branching ratio
1257  //all branching ratios are re-normalized
1258  clearFreezeOut();
1259  PDataBase *base=makeDataBase();
1260 
1261  //get parent key
1262  Int_t parent_key = makeDataBase()->GetEntry(parent);
1263  if (parent_key < 0) {
1264  cout << "PStaticData::addDecay: parent " << parent << " not found in data base" << endl;
1265  return -1;
1266  }
1267 
1268  Int_t pid=GetParticleIDByKey(parent_key);
1269  if (pid<0) {
1270  return -1;
1271  }
1272  if (didx<0) {
1273  if (pid<1000) didx=pid*32;
1274  else didx=pid;
1275  while (makeDataBase()->GetEntryInt("didx",didx) >=0 ) {
1276  didx++;
1277  }
1278  if (*system_alloc_verbosity)
1279  Info("AddDecay","(%s) Decay index %i: %s", PRINT_AUTO_ALLOC,didx,name);
1280  }
1281 
1282 
1283 
1284  //check if didx already exists
1285  if (makeDataBase()->GetEntryInt("didx",didx) >=0 ) {
1286  cout << "PStaticData::addDecay: didx " << didx << " already used in data base" << endl;
1287  return -1;
1288  }
1289  Int_t dkey = makeDataBase()->AddListEntry(parent,"pnmodes", "link",name);
1290  if (dkey < 0) {
1291  Warning("AddDecay","Unable to add decay entry to data base");
1292  return -1;
1293  }
1294 
1295  //now add the daughters
1296  char *arr1[7];
1297  Int_t arr1_s=7; //max 7 decay products
1298 
1299 
1300  Tokenize(daughters, ",", arr1, &arr1_s);
1301  //does decay already exist?
1302 
1303  Int_t pids[8];
1304  pids[0] = pid;
1305  // cout << pid << endl;
1306  for (int pat = 0; pat < arr1_s; pat++) {
1307  pids[pat+1] = GetParticleID(arr1[pat]);
1308  //cout << pids[pat+1]<<endl;
1309  }
1310  if (GetDecayKey(pids, arr1_s)>=0) {
1311  Warning("AddDecay","Decay already defined");
1312  return -1;
1313  }
1314 
1315 
1316  for (int pat = 0; pat < arr1_s; pat++) {
1317  char * partc=arr1[pat];
1318  // Int_t *pkey = new int(base->GetEntry(partc));
1319  //This takes into account aliases:
1320  Int_t *pkey = new int( makeStaticData()->GetParticleKey(partc));
1321  if (*pkey<0) {
1322  cout << "Error: processing decay: do not find pid " << partc << endl;
1323  }
1324  const char *ds;
1325  if (pat==0) ds="d1";
1326  if (pat==1) ds="d2";
1327  if (pat==2) ds="d3";
1328  if (pat==3) ds="d4";
1329  if (pat==4) ds="d5";
1330  if (pat==5) ds="d6";
1331  if (pat==6) ds="d7";
1332  if (pat>6) {
1333  Warning("AddDecay","Too many particles");
1334  return -1;
1335  }
1336 
1337  base->SetParamInt (dkey,ds,pkey);
1338  }
1339  //set default values
1340  Int_t *ii;
1341  makeDataBase()->GetParamInt(parent_key,"pid",&ii);
1342  base->SetParamInt (dkey, "ppid",ii); //set parent id
1343 
1344  ii=new int(didx);
1345  base->SetParamInt (dkey, "didx",ii); //decay mode index
1346 
1347  ii=new int(0); //never destructed, but called only once!
1348  if (!base->SetParamInt (dkey, "widx", ii))
1349  return -1;
1350 
1351  Double_t * dd=new double(br);
1352  if (!base->SetParamDouble (dkey, "br", dd))
1353  return -1;
1354  if (!base->SetParamDouble (dkey, "brorig", new Double_t(br)))
1355  return -1;
1356  dd=new Double_t(0.);
1357  if (!base->SetParamDouble (dkey, "ethreshold", dd))
1358  return -1;
1359  dd=new Double_t(1.);
1360  if (!base->SetParamDouble (dkey, "scfactor", dd))
1361  return -1;
1362 
1363  if (pid>1000) //Do not norm compostite
1364  return didx;
1365 
1366  if (! NormParticleBRbyKey(parent_key) ) return -1;
1367  return didx;
1368 
1369 }
1370 */
1371 
1373  Int_t products = GetDecayNProductsByKey(key);
1374  // cout << products << endl;
1375  if (products == 1)
1376  makeDataBase()->ListEntries(key, 0, "name,didx,br,d1:name");
1377  if (products == 2)
1378  makeDataBase()->ListEntries(key, 0, "name,didx,br,d1:name,d2:name");
1379  if (products == 3)
1380  makeDataBase()->ListEntries(key, 0, "name,didx,br,d1:name,d2:name,d3:name");
1381  if (products == 4)
1383  key, 0, "name,didx,br,d1:name,d2:name,d3:name,d4:name");
1384  if (products == 5)
1386  key, 0, "name,didx,br,d1:name,d2:name,d3:name,d4:name,d5:name");
1387  if (products == 6)
1389  key, 0, "name,didx,br,d1:name,d2:name,d3:name,d4:name,d5:name,d6:name");
1390  if (products == 7)
1392  key,
1393  0,
1394  "name,didx,br,d1:name,d2:name,d3:name,d4:name,d5:name,d6:name,d7:name");
1395 };
1396 
1398  // retrieve number of products by mode key
1399  if (makeDataBase()->GetParamInt(key, d7_param, &i_result)) return 7;
1400  if (makeDataBase()->GetParamInt(key, d6_param, &i_result)) return 6;
1401  if (makeDataBase()->GetParamInt(key, d5_param, &i_result)) return 5;
1402  if (makeDataBase()->GetParamInt(key, d4_param, &i_result)) return 4;
1403  if (makeDataBase()->GetParamInt(key, d3_param, &i_result)) return 3;
1404  if (makeDataBase()->GetParamInt(key, d2_param, &i_result)) return 2;
1405  if (makeDataBase()->GetParamInt(key, d1_param, &i_result)) return 1;
1406  return 0;
1407 };
1408 
1410  // retrieve number of products by mode index
1411  if (makeDataBase()->GetParamInt(didx_param, id, d7_param, &i_result))
1412  return 7;
1413  if (makeDataBase()->GetParamInt(didx_param, id, d6_param, &i_result))
1414  return 6;
1415  if (makeDataBase()->GetParamInt(didx_param, id, d5_param, &i_result))
1416  return 5;
1417  if (makeDataBase()->GetParamInt(didx_param, id, d4_param, &i_result))
1418  return 4;
1419  if (makeDataBase()->GetParamInt(didx_param, id, d3_param, &i_result))
1420  return 3;
1421  if (makeDataBase()->GetParamInt(didx_param, id, d2_param, &i_result))
1422  return 2;
1423  if (makeDataBase()->GetParamInt(didx_param, id, d1_param, &i_result))
1424  return 1;
1425  return 0;
1426 };
1427 
1428 int PStaticData::GetDecayNProducts(const char* id) {
1429  // number of products by name
1430  if (makeDataBase()->GetParamInt((char*) id, "d7", &i_result)) return 7;
1431  if (makeDataBase()->GetParamInt((char*) id, "d6", &i_result)) return 6;
1432  if (makeDataBase()->GetParamInt((char*) id, "d5", &i_result)) return 5;
1433  if (makeDataBase()->GetParamInt((char*) id, "d4", &i_result)) return 4;
1434  if (makeDataBase()->GetParamInt((char*) id, "d3", &i_result)) return 3;
1435  if (makeDataBase()->GetParamInt((char*) id, "d2", &i_result)) return 2;
1436  if (makeDataBase()->GetParamInt((char*) id, "d1", &i_result)) return 1;
1437  return 0;
1438 }
1439 
1440 int PStaticData::GetDecayParent(const int& id) {
1441  if (!makeDataBase()->GetParamInt(didx_param, id, ppid_param, &i_result)) {
1442  // if not found obviously no parent
1443  return 0;
1444  }
1445  return *i_result;
1446 }
1447 
1449  if (!makeDataBase()->GetParamInt(id, ppid_param, &i_result)) {
1450  // if not found obviously no parent
1451  return 0;
1452  }
1453  return *i_result;
1454 }
1455 
1457  // return value is -1 on failure
1458 
1459  Int_t* pos;
1460  if (!makeDataBase()->GetParamInt(key, didx_param, &pos)) return -1;
1461  return *pos;
1462 }
1463 
1464 int PStaticData::GetDecayIdx(int* pid, int n) {
1465  // decay-mode index from parent and product ids;
1466  // n is the size of the array
1467  // arguments: pointer to pid array of parent & products,
1468  // number of products
1469 
1470  int i, nid[n];
1471  if (n < 2 || !pid) return -1;
1472  for (i = 0; i <= n; ++i) {
1473  if (!PStaticData::IsParticleValid(pid[i])) {
1474  cout << "PStaticData:: GetDecayIdx: id not found:" << pid[i] << endl;
1475  return -2;
1476  } else if (i)
1477  nid[i - 1] = pid[i]; // make own copy of product array
1478  }
1479  isort(nid, n); // sort the array entries
1480 
1481  int id = pid[0], *nm; // parent id, number of decay modes
1482  //Get count info
1483 
1484  if (!makeDataBase()->GetParamInt(pid_param, id, count_param, &nm)) {
1485  return -3;
1486  }
1487  if (!nm) return -4;
1488  Int_t count;
1489  //now loop over decay modes
1490  Int_t key = makeDataBase()->GetEntryInt(pid_param, id);
1491  Int_t listkey = -1;
1492  Int_t tid[11];
1493  while (makeDataBase()->MakeListIterator(key, "pnmodes", "link", &listkey)) {
1494  tid[0] = 10;
1495  GetDecayModeByKey(listkey, tid); // retrieve current mode info
1496  if (tid[0] == n) { // number of products matches input
1497  isort(tid + 1, n); // sort the current mode product pid array
1498  count = 0; // reset the match counter
1499  for (i = 0; i < n; ++i)
1500  count += (tid[i + 1] == nid[i]);
1501  if (count == n) { // input matched
1502  return GetDecayIdxByKey(listkey);
1503  }
1504  }
1505  }
1506 
1507  return -1;
1508 }
1509 
1510 int PStaticData::GetDecayKey(int* pid, int n) {
1511  // decay-mode key from parent and product ids;
1512  // n is the size of the daughters array
1513  // arguments: pointer to pid array of parent & products,
1514  // number of products
1515 
1516  int i, nid[n];
1517  if (n < 1 || !pid) return -1;
1518  for (i = 0; i <= n; ++i) {
1519  if (!PStaticData::IsParticleValid(pid[i])) {
1520  Warning("GetDecayKey", "id %i not found", pid[i]);
1521  return -2;
1522  } else if (i) {
1523  nid[i - 1] = pid[i]; // make own copy of product array
1524  }
1525  }
1526 
1527  isort(nid, n); // sort the array entries
1528 
1529  int id = pid[0], *nm; // parent id, number of decay modes
1530  //Get count info
1531  if (!makeDataBase()->GetParamInt(pid_param, id, count_param, &nm)) {
1532  return -3;
1533  }
1534  if (!nm) return -4;
1535  Int_t count;
1536  //now loop over decay modes
1537  Int_t key = makeDataBase()->GetEntryInt(pid_param, id);
1538  Int_t listkey = -1;
1539  Int_t tid[11];
1540  while (makeDataBase()->MakeListIterator(key, "pnmodes", "link", &listkey)) {
1541  tid[0] = 10;
1542  GetDecayModeByKey(listkey, tid); // retrieve current mode info
1543  if (tid[0] == n) { // number of products matches input
1544  isort(tid + 1, n); // sort the current mode product pid array
1545  count = 0; // reset the match counter
1546  for (i = 0; i < n; ++i)
1547  count += (tid[i + 1] == nid[i]);
1548  if (count == n) { // input matched
1549  return listkey;
1550  }
1551  }
1552  }
1553 
1554  return -1;
1555 }
1556 
1557 
1558 void PStaticData::GetDecayMode(int idx, int* id) {
1559  // Retrieves the decay mode info for a given channel n.
1560  // _______________________________________________________________________
1561  // ARGUMENTS: 1. decay-mode index (PPosition),
1562  // 2. pointer to existing integer array (must have large
1563  // enough dimension), 3. pointer to existing double (optional).
1564  // _______________________________________________________________________
1565  // RETURNS: int array with N, i_1, i_2,..., i_N, where N is
1566  // the number of products for the decay mode with index n,
1567  // followed by the pids of these products
1568  //
1569  // N should contain the maximum number of the array-size of before
1570  // calling this function
1571  // if the maximum is exceeded, or any other error occurs, N is set to 0
1572  Int_t *d1_key, *d2_key, *d3_key, *d4_key, *d5_key, *d6_key, *d7_key,
1573  found = 0;
1574  ;
1575  if (makeDataBase()->GetParamInt(didx_param, idx, d1_param, &d1_key))
1576  found = 1;
1577  if (makeDataBase()->GetParamInt(didx_param, idx, d2_param, &d2_key))
1578  found = 2;
1579  if (makeDataBase()->GetParamInt(didx_param, idx, d3_param, &d3_key))
1580  found = 3;
1581  if (makeDataBase()->GetParamInt(didx_param, idx, d4_param, &d4_key))
1582  found = 4;
1583  if (makeDataBase()->GetParamInt(didx_param, idx, d5_param, &d5_key))
1584  found = 5;
1585  if (makeDataBase()->GetParamInt(didx_param, idx, d6_param, &d6_key))
1586  found = 6;
1587  if (makeDataBase()->GetParamInt(didx_param, idx, d7_param, &d7_key))
1588  found = 7;
1589 
1590  if (found > *id) {
1591  cout << "PStaticData:: size too low" << endl;
1592  *id = 0;
1593  return;
1594  } else
1595  *id = found;
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;
1598  if ((found > 0) && !makeDataBase()->GetParamInt(*d1_key, pid_param, &d1_p)) {
1599  cout << "PStaticData:: Mode: unable to unpack key1 " << *d1_key << endl;
1600  *id = 0;
1601  } else if ((found > 1)
1602  && !makeDataBase()->GetParamInt(*d2_key, pid_param, &d2_p)) {
1603  cout << "PStaticData:: Mode: unable to unpack key2 " << *d2_key << endl;
1604  *id = 0;
1605  } else if ((found > 2)
1606  && !makeDataBase()->GetParamInt(*d3_key, pid_param, &d3_p)) {
1607  cout << "PStaticData:: Mode: unable to unpack key3 " << *d3_key << endl;
1608  *id = 0;
1609  } else if ((found > 3)
1610  && !makeDataBase()->GetParamInt(*d4_key, pid_param, &d4_p)) {
1611  cout << "PStaticData:: Mode: unable to unpack key4 " << *d4_key << endl;
1612  *id = 0;
1613  } else if ((found > 4)
1614  && !makeDataBase()->GetParamInt(*d5_key, pid_param, &d5_p)) {
1615  cout << "PStaticData:: Mode: unable to unpack key5 " << *d5_key << endl;
1616  *id = 0;
1617  } else if ((found > 5)
1618  && !makeDataBase()->GetParamInt(*d6_key, pid_param, &d6_p)) {
1619  cout << "PStaticData:: Mode: unable to unpack key6 " << *d6_key << endl;
1620  *id = 0;
1621  } else if ((found > 6)
1622  && !makeDataBase()->GetParamInt(*d7_key, pid_param, &d7_p)) {
1623  cout << "PStaticData:: Mode: unable to unpack key7 " << *d7_key << endl;
1624  *id = 0;
1625  }
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;
1633 }
1634 
1635 
1636 void PStaticData::GetDecayModeByKey(int idx, int* id) {
1637  //same as above, but by data base key
1638  Int_t *d1_key, *d2_key, *d3_key, *d4_key, *d5_key, *d6_key, *d7_key,
1639  found = 0;
1640  if (makeDataBase()->GetParamInt(idx, d1_param, &d1_key)) found = 1;
1641  if (makeDataBase()->GetParamInt(idx, d2_param, &d2_key)) found = 2;
1642  if (makeDataBase()->GetParamInt(idx, d3_param, &d3_key)) found = 3;
1643  if (makeDataBase()->GetParamInt(idx, d4_param, &d4_key)) found = 4;
1644  if (makeDataBase()->GetParamInt(idx, d5_param, &d5_key)) found = 5;
1645  if (makeDataBase()->GetParamInt(idx, d6_param, &d6_key)) found = 6;
1646  if (makeDataBase()->GetParamInt(idx, d7_param, &d7_key)) found = 7;
1647 
1648  if (found > *id) {
1649  cout << "PStaticData:: size too low" << endl;
1650  *id = 0;
1651  return;
1652  } else
1653  *id = found;
1654  // cout << "id is " << *id << 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;
1657  if (*id > 0 && !makeDataBase()->GetParamInt(*d1_key, pid_param, &d1_p)) {
1658  cout << "PStaticData:: ModeByKey: unable to unpack key1 " << *d1_key
1659  << endl;
1660  *id = 0;
1661  } else if (*id > 1
1662  && !makeDataBase()->GetParamInt(*d2_key, pid_param, &d2_p)) {
1663  cout << "PStaticData:: ModeByKey: unable to unpack key2 " << *d2_key
1664  << endl;
1665  *id = 0;
1666  } else if (*id > 2
1667  && !makeDataBase()->GetParamInt(*d3_key, pid_param, &d3_p)) {
1668  cout << "PStaticData:: ModeByKey: unable to unpack key3 " << *d3_key
1669  << endl;
1670  *id = 0;
1671  } else if (*id > 3
1672  && !makeDataBase()->GetParamInt(*d4_key, pid_param, &d4_p)) {
1673  cout << "PStaticData:: ModeByKey: unable to unpack key4 " << *d4_key
1674  << endl;
1675  *id = 0;
1676  } else if (*id > 4
1677  && !makeDataBase()->GetParamInt(*d5_key, pid_param, &d5_p)) {
1678  cout << "PStaticData:: ModeByKey: unable to unpack key5 " << *d5_key
1679  << endl;
1680  *id = 0;
1681  } else if (*id > 5
1682  && !makeDataBase()->GetParamInt(*d6_key, pid_param, &d6_p)) {
1683  cout << "PStaticData:: ModeByKey: unable to unpack key6 " << *d6_key
1684  << endl;
1685  *id = 0;
1686  } else if (*id > 6
1687  && !makeDataBase()->GetParamInt(*d7_key, pid_param, &d7_p)) {
1688  cout << "PStaticData:: ModeByKey: unable to unpack key7 " << *d7_key
1689  << endl;
1690  *id = 0;
1691  }
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;
1699 }
1700 
1701 
1702 double PStaticData::GetParticleTotalWidth(const int& id) {
1703  // PWidth[id]
1704  if (!makeDataBase()->GetParamDouble(pid_param, id, width_param, &d_result)) {
1705  cout << "PStaticData::GetParticleTotalWidth: " << id << " not found"
1706  << endl;
1707  return 0;
1708  }
1709  return *d_result;
1710 }
1711 
1713  // PWidth[id]
1714  if (!makeDataBase()->GetParamDouble(key, width_param, &d_result)) {
1715  cout << "PStaticData::GetParticleTotalWidthByKey: " << key << " not found"
1716  << endl;
1717  return 0;
1718  }
1719  return *d_result;
1720 }
1721 
1722 
1723 void listParticle(int id) {
1724 
1725  if (id < 0) {
1726  makeStaticData(); //this fill data base
1727  makeDataBase()->ListEntries(-1, 1, "pid,*name");
1728  } else
1730 }
1731 
1732 void listModes(int id) { makeStaticData()->PrintParticle(id); }
1733 
1734 
1735 Bool_t PStaticData::Tokenize(const char* options,
1736  const char* delimiter,
1737  char** array,
1738  int* size) {
1739  for (int i = 0; i < *size; i++)
1740  array[i] = nullptr;
1741 
1742  char* mystack = new char[strlen(options) + 1];
1743  strcpy(mystack, options);
1744 
1745  Int_t pat = 1;
1746  array[0] = mystack;
1747 
1748  while (strstr(mystack, delimiter)) {
1749  if (pat == *size) {
1750  cout << "Tokenize: size " << *size << " is too small for " << options
1751  << " ,delim:" << delimiter << endl;
1752  }
1753  char* pos = strstr(mystack, delimiter);
1754  *pos = '\0';
1755  mystack = pos + strlen(delimiter);
1756  array[pat] = mystack;
1757  //cout << "+-: "<<array[pat] << endl;
1758  pat++;
1759  }
1760 
1761  *size = pat;
1762 
1763  for (int i = 0; i < *size; i++) {
1764  //remove leading/trailing spaces
1765 
1766  remove_spaces(&array[i]);
1767  }
1768 
1769  return kTRUE;
1770 }
1771 
1772 void PStaticData::remove_spaces(char** partc) {
1773 
1774  while (**partc == ' ')
1775  (*partc)++;
1776  if (strlen(*partc)) {
1777  int partend = strlen(*partc) - 1;
1778  // cout << partc << ":" << partc[partend] << endl;
1779  while ((*partc)[partend] == ' ' && partend >= 0) {
1780  (*partc)[partend] = '\0';
1781  partend--;
1782  }
1783  }
1784 }
1785 
1786 void PStaticData::dsort(Double_t* a, int n) {
1787  // Sort in ascending order the first n entries of the array *a.
1788  int i, j, l, m, r, rt[20], lt[20], level = 1;
1789  Double_t x, w;
1790  lt[0] = 1;
1791  rt[0] = n;
1792 a:
1793  l = lt[level - 1];
1794  r = rt[level - 1];
1795  --level;
1796 b:
1797  if (r <= l) {
1798  if (level > 0)
1799  goto a;
1800  else
1801  return;
1802  }
1803  i = l;
1804  j = r;
1805  m = (l + r) / 2;
1806  x = *(a + m - 1);
1807  // cout << "X: " << x << endl;
1808 c:
1809  while (*(a + i - 1) < x)
1810  ++i;
1811  while (*(a + j - 1) > x)
1812  --j;
1813  while (i <= j) {
1814  w = *(a + i - 1);
1815  *(a + i - 1) = *(a + j - 1);
1816  *(a + j - 1) = w;
1817  ++i;
1818  --j;
1819  if (i < j) goto c;
1820  }
1821  ++level;
1822  if (r - i >= j - l) {
1823  lt[level - 1] = i;
1824  rt[level - 1] = r;
1825  r = j;
1826  } else {
1827  lt[level - 1] = l;
1828  rt[level - 1] = j;
1829  }
1830  goto b;
1831 }
1832 
PStaticData::GetDecayBRFlag
int GetDecayBRFlag(int didx)
Definition: PStaticData.cxx:875
PStaticData::pkf_param
Int_t pkf_param
Definition: PStaticData.h:299
PStaticData::SetPWidx
void SetPWidx(const int &, const int &)
Definition: PStaticData.cxx:804
PStaticData::GetTF1
TF1 * GetTF1(const int &)
Definition: PStaticData.cxx:857
PStaticData::hdepth_param
Int_t hdepth_param
Definition: PStaticData.h:302
PStaticData::SetTF1
void SetTF1(const int &, TF1 *mesh)
Definition: PStaticData.cxx:849
PStaticData::GetParticleKF
int GetParticleKF(const int Id)
Definition: PStaticData.cxx:476
PStaticData::widx_param
Int_t widx_param
Definition: PStaticData.h:300
PStaticData::IsParticleMeson
int IsParticleMeson(const int &id)
Definition: PStaticData.cxx:501
PStaticData::ethreshold_param
Int_t ethreshold_param
Definition: PStaticData.h:300
PStaticData::pid_param
Int_t pid_param
Definition: PStaticData.h:294
PStaticData::GetParticleIsospin
int GetParticleIsospin(const int &id)
Definition: PStaticData.cxx:638
PStaticData::GetAliasParent
int GetAliasParent(const char *alias_name)
Definition: PStaticData.cxx:311
PStaticData::IsDecayHadronic
Int_t IsDecayHadronic(Int_t didx)
Definition: PStaticData.cxx:1205
PDataBase::GetName
const char * GetName(Int_t key)
Definition: PDataBase.cxx:102
PStaticData::SetDecayBRFlag
void SetDecayBRFlag(int didx, int flag)
Definition: PStaticData.cxx:882
PStdData.h
PStaticData::SetDecayEmin
void SetDecayEmin(const int &idx, const double v)
Definition: PStaticData.cxx:919
PStaticData::d_result
Double_t * d_result
Definition: PStaticData.h:292
NBATCH_NAME
#define NBATCH_NAME
Definition: Pdefines.h:18
PStaticData::pnmodes_param
Int_t pnmodes_param
Definition: PStaticData.h:303
PStaticData::SetParticleParity
void SetParticleParity(const char *id, Int_t parity)
Definition: PStaticData.cxx:582
PStaticData::GetParticleIDbyKF
int GetParticleIDbyKF(const int kf)
Definition: PStaticData.cxx:486
PDataBase::GetParamString
Int_t GetParamString(const char *paramname)
Definition: PDataBase.cxx:181
PStaticData::count_param
Int_t count_param
Definition: PStaticData.h:302
PStaticData::lalias_param
Int_t lalias_param
Definition: PStaticData.h:306
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
PStaticData::GetBatchValue
Double_t * GetBatchValue(const char *name, Int_t make_val=1)
Definition: PStaticData.cxx:194
PStaticData::SetTWidthMesh
void SetTWidthMesh(const int &, PMesh *mesh)
Definition: PStaticData.cxx:815
PStaticData::defkey_param
Int_t defkey_param
Definition: PStaticData.h:306
PStaticData::FreezeDecayBR
void FreezeDecayBR(Int_t id, Int_t brn)
Definition: PStaticData.cxx:1169
PStaticData::brorig_param
Int_t brorig_param
Definition: PStaticData.h:302
PStaticData::SetParticleCharge
void SetParticleCharge(const char *id, Int_t charge)
Definition: PStaticData.cxx:555
PStaticData::MakeDirectoryEntry
int MakeDirectoryEntry(const char *name, const char *n, const char *l, const char *ename)
Definition: PStaticData.cxx:162
PStaticData::ispin_param
Int_t ispin_param
Definition: PStaticData.h:297
PStaticData
Definition: PStaticData.h:32
PStaticData::SetParticleTotalWidth
void SetParticleTotalWidth(Int_t id, Float_t wid)
Definition: PStaticData.cxx:754
PStaticData::GetParticleTotalWidthByKey
double GetParticleTotalWidthByKey(const int &id)
Definition: PStaticData.cxx:1712
PStaticData::tf1_param
Int_t tf1_param
Definition: PStaticData.h:300
PStaticData::AddParticle
int AddParticle(int pid, const char *name, double mass)
Definition: PStaticData.cxx:364
PStaticData::GetDecayMode
void GetDecayMode(const int, int *n)
Definition: PStaticData.cxx:1558
PRINT_AUTO_ALLOC
#define PRINT_AUTO_ALLOC
Definition: Pdefines.h:2
PStaticData::GetDecayBR
Double_t GetDecayBR(Int_t id)
Definition: PStaticData.cxx:1010
PStaticData::isort
static void isort(int *i, int n)
Definition: PStaticData.h:250
PStaticData::d3_param
Int_t d3_param
Definition: PStaticData.h:303
PStaticData::meson_param
Int_t meson_param
Definition: PStaticData.h:296
PStaticData::d6_param
Int_t d6_param
Definition: PStaticData.h:304
PStaticData::SetParticleUMass
void SetParticleUMass(const int &id, const double v)
Definition: PStaticData.h:155
PStaticData::dsort
static void dsort(Double_t *, int)
Definition: PStaticData.cxx:1786
PStaticData::GetDecayName
const char * GetDecayName(Int_t id)
Definition: PStaticData.cxx:723
PStaticData::lepton_param
Int_t lepton_param
Definition: PStaticData.h:296
PStaticData::GetParticleLMass
double GetParticleLMass(const int &id)
Definition: PStaticData.cxx:944
PStaticData::GetParticleMassByKey
double GetParticleMassByKey(const int &id)
Definition: PStaticData.cxx:696
PStaticData::ppid_param
Int_t ppid_param
Definition: PStaticData.h:303
PStaticData::c_result
const char * c_result
Definition: PStaticData.h:291
PStaticData::GetParticleBaryon
int GetParticleBaryon(const int &id)
Definition: PStaticData.cxx:517
PStaticData::baryon_param
Int_t baryon_param
Definition: PStaticData.h:296
PStaticData::br_param
Int_t br_param
Definition: PStaticData.h:302
PStaticData::GetPWidx
int GetPWidx(const int &)
Definition: PStaticData.cxx:781
PStaticData::GetDecayParent
int GetDecayParent(const int &)
Definition: PStaticData.cxx:1440
makeStaticData
PStaticData * makeStaticData()
Definition: PStaticData.cxx:29
PStaticData::AddAlias
int AddAlias(const char *old_name, const char *new_name)
Definition: PStaticData.cxx:298
makeDataBase
PDataBase * makeDataBase()
Definition: PDataBase.cxx:26
PStaticData::GetTWidx
int GetTWidx(const int &)
Definition: PStaticData.cxx:768
PStaticData::SetTDepth
void SetTDepth(const int &, const int &)
Definition: PStaticData.cxx:988
PStaticData::name_param
Int_t name_param
Definition: PStaticData.h:295
PStaticData::freeze
Bool_t freeze
Definition: PStaticData.h:308
PMesh
Definition: PMesh.h:13
PDataBase::MakeParamDouble
Int_t MakeParamDouble(const char *paramname, const char *descr)
Definition: PDataBase.cxx:110
PStaticData::GetTDepth
int GetTDepth(const int &)
Definition: PStaticData.cxx:980
PStaticData::GetParticleNChannels
int GetParticleNChannels(const int &id)
Definition: PStaticData.cxx:1182
PStaticData::GetDecayIdxByKey
int GetDecayIdxByKey(int key)
Definition: PStaticData.cxx:1456
PStaticData::brflag_param
Int_t brflag_param
Definition: PStaticData.h:305
PStaticData::SetDecayBRByKey
bool SetDecayBRByKey(int key, double br, int mode)
Definition: PStaticData.cxx:1046
fStaticData
PStaticData & fStaticData()
Definition: PStaticData.cxx:24
PStaticData::GetSecondaryKey
int GetSecondaryKey(int key, int defkey)
Definition: PStaticData.cxx:337
PStaticData::GetParticleSpin
int GetParticleSpin(const int &id)
Definition: PStaticData.cxx:619
Pdefines.h
PStaticData::GetDecayKey
int GetDecayKey(int *pid, int n)
Definition: PStaticData.cxx:1510
PStaticData::GetParticleIDByKey
int GetParticleIDByKey(int key)
Definition: PStaticData.cxx:242
PStaticData::GetParticleCharge
int GetParticleCharge(const int &id)
Definition: PStaticData.cxx:600
PStaticData::spin_param
Int_t spin_param
Definition: PStaticData.h:297
PStaticData::i_result
Int_t * i_result
Definition: PStaticData.h:285
PStaticData::system_alloc_verbosity
Double_t * system_alloc_verbosity
Definition: PStaticData.h:310
PStaticData::SetParticleLepton
void SetParticleLepton(const char *id, Int_t num=1)
Definition: PStaticData.cxx:546
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
PStaticData::GetPWidthMesh
PMesh * GetPWidthMesh(const int &)
Definition: PStaticData.cxx:840
PStaticData::GetParticleID
int GetParticleID(const char *id, int warn=1)
Definition: PStaticData.cxx:216
PStaticData::PStaticData
PStaticData()
Definition: PStaticData.cxx:31
PStaticData::SetParticleMeson
void SetParticleMeson(const char *id, Int_t num=1)
Definition: PStaticData.cxx:536
LBATCH_NAME
#define LBATCH_NAME
Definition: Pdefines.h:19
PStaticData::GetDecayNameByKey
const char * GetDecayNameByKey(Int_t key)
Definition: PStaticData.cxx:730
PStaticData::nalias_param
Int_t nalias_param
Definition: PStaticData.h:306
PStaticData::IsParticle
int IsParticle(const int &id, const char *name)
Definition: PStaticData.cxx:267
PStaticData::GetHDepth
int GetHDepth(const int &)
Definition: PStaticData.cxx:995
PStaticData::GetParticleLepton
int GetParticleLepton(const int &id)
Definition: PStaticData.cxx:591
PDataBase::SetParamInt
Bool_t SetParamInt(Int_t key, const char *paramname, Int_t *result)
Definition: PDataBase.cxx:418
PStaticData::tdepth_param
Int_t tdepth_param
Definition: PStaticData.h:302
PStaticData::GetTWidthMesh
PMesh * GetTWidthMesh(const int &)
Definition: PStaticData.cxx:824
PStaticData::GetParticleEmin
double GetParticleEmin(const int &id)
Definition: PStaticData.cxx:927
PDataBase::GetEntryInt
Int_t GetEntryInt(const char *paramname, Int_t value)
Definition: PDataBase.cxx:473
PStaticData::didx_param
Int_t didx_param
Definition: PStaticData.h:299
PStaticData::GetDecayPartialWidthByKey
Double_t GetDecayPartialWidthByKey(Int_t id)
Definition: PStaticData.cxx:1022
PStaticData::GetParticleNChannelsByKey
int GetParticleNChannelsByKey(int id)
Definition: PStaticData.cxx:1199
PDataBase::GetParamTObj
Int_t GetParamTObj(const char *paramname)
Definition: PDataBase.cxx:200
PStaticData::GetParticleTotalWidth
double GetParticleTotalWidth(const int &id)
Definition: PStaticData.cxx:1702
PStaticData::GetDecayNProducts
int GetDecayNProducts(const int &)
Definition: PStaticData.cxx:1409
listParticle
void listParticle(int id)
Definition: PStaticData.cxx:1723
PStaticData::SetParticleSpin
void SetParticleSpin(const char *id, Int_t spin)
Definition: PStaticData.cxx:564
PStaticData::charge_param
Int_t charge_param
Definition: PStaticData.h:297
PStaticData::lmass_param
Int_t lmass_param
Definition: PStaticData.h:300
PStaticData::d7_param
Int_t d7_param
Definition: PStaticData.h:304
PStaticData::SetTotalNormalization
void SetTotalNormalization(char *p, int flag=1)
Definition: PStaticData.cxx:896
v
__m128 v
Definition: L1/vectors/P4_F32vec4.h:1
PStaticData::SetTWidx
void SetTWidx(const int &, const int &)
Definition: PStaticData.cxx:793
PStaticData::parity_param
Int_t parity_param
Definition: PStaticData.h:298
makeStdData
PStdData * makeStdData()
Definition: PStdData.cxx:40
PStaticData::SetParticleIsospin
void SetParticleIsospin(const char *id, Int_t isospin)
Definition: PStaticData.cxx:573
PStaticData::GetParticleParity
int GetParticleParity(const int &id)
Definition: PStaticData.cxx:657
PStaticData::Tokenize
static Bool_t Tokenize(const char *options, const char *delimiter, char **array, int *size)
Definition: PStaticData.cxx:1735
PDataBase::AddEntry
Bool_t AddEntry(Int_t key, const char *name)
Definition: PDataBase.cxx:516
PStaticData::SetParticleEmin
void SetParticleEmin(const int &id, const double v)
Definition: PStaticData.cxx:936
PStaticData::GetDecayModeByKey
void GetDecayModeByKey(const int, int *n)
Definition: PStaticData.cxx:1636
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
PStaticData::mass_param
Int_t mass_param
Definition: PStaticData.h:298
PStaticData::GetDecayNProductsByKey
int GetDecayNProductsByKey(const int &key)
Definition: PStaticData.cxx:1397
m
__m128 m
Definition: L1/vectors/P4_F32vec4.h:26
PStaticData::SetParticleLMass
void SetParticleLMass(const int &id, const double v)
Definition: PStaticData.h:146
PStaticData::t_result
TObject * t_result
Definition: PStaticData.h:293
PStaticData.h
PDataBase::GetParamInt
Int_t GetParamInt(const char *paramname, Int_t length=-1)
Definition: PDataBase.cxx:188
PDataBase::ListEntries
Bool_t ListEntries(Int_t key=-1, Int_t option=0, const char *pattern=nullptr)
Definition: PDataBase.cxx:680
PStaticData::PrintDecayByKey
void PrintDecayByKey(int key)
Definition: PStaticData.cxx:1372
PStaticData::GetDecayPartialWidth
Double_t GetDecayPartialWidth(Int_t id)
Definition: PStaticData.cxx:1017
PStaticData::d4_param
Int_t d4_param
Definition: PStaticData.h:304
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
PStaticData::GetParticleName
const char * GetParticleName(const int &id)
Definition: PStaticData.cxx:231
PStaticData::mesh_param
Int_t mesh_param
Definition: PStaticData.h:300
PStaticData::d1_param
Int_t d1_param
Definition: PStaticData.h:303
PStaticData::GetParticleKey
int GetParticleKey(const int &id)
Definition: PStaticData.cxx:249
PDataBase::AddListEntry
Int_t AddListEntry(const char *name, const char *count, const char *link, const char *newname)
Definition: PDataBase.cxx:539
PStaticData::d5_param
Int_t d5_param
Definition: PStaticData.h:304
PStaticData::remove_spaces
static void remove_spaces(char **partc)
Definition: PStaticData.cxx:1772
PStaticData::GetParticleMass
double GetParticleMass(const int &id)
Definition: PStaticData.cxx:676
PStaticData::SetPWidthMesh
void SetPWidthMesh(const int &, PMesh *mesh)
Definition: PStaticData.cxx:832
PDataBase::MakeParamInt
Int_t MakeParamInt(const char *paramname, const char *descr)
Definition: PDataBase.cxx:143
PDataBase::SetParamDouble
Bool_t SetParamDouble(Int_t key, const char *paramname, Double_t *result)
Definition: PDataBase.cxx:381
PStaticData::GetDecayParentByKey
int GetDecayParentByKey(const int &)
Definition: PStaticData.cxx:1448
PStaticData::clearFreezeOut
void clearFreezeOut(void)
Definition: PStaticData.h:40
PStaticData::GetDecayIdx
int GetDecayIdx(int *pid, int n)
Definition: PStaticData.cxx:1464
PDataBase
Definition: PDataBase.h:27
PStaticData::SetDecayBR
bool SetDecayBR(int didx, double br, int mode)
Definition: PStaticData.cxx:1028
PStaticData::SetParticleBaryon
void SetParticleBaryon(const char *id, Int_t num=1)
Definition: PStaticData.cxx:526
PStaticData::SetParticleMass
void SetParticleMass(Int_t id, Float_t mass)
Definition: PStaticData.cxx:705
PStaticData::IsParticleValid
int IsParticleValid(const int &id)
Definition: PStaticData.cxx:273
PStaticData::width_param
Int_t width_param
Definition: PStaticData.h:298
PStaticData::PrintParticleByKey
void PrintParticleByKey(int pid)
Definition: PStaticData.cxx:446
PStaticData::PrintParticle
void PrintParticle(int pid)
Definition: PStaticData.cxx:441
PStaticData::umass_param
Int_t umass_param
Definition: PStaticData.h:301
PStaticData::NormParticleBR
bool NormParticleBR(Int_t id)
Definition: PStaticData.cxx:1131
PDataBase::GetParamDouble
Int_t GetParamDouble(const char *paramname)
Definition: PDataBase.cxx:175
PStaticData::SetHDepth
void SetHDepth(const int &, const int &)
Definition: PStaticData.cxx:1003
PStaticData::IsParticleHadron
int IsParticleHadron(const int &id)
Definition: PStaticData.cxx:511
PStaticData::d2_param
Int_t d2_param
Definition: PStaticData.h:303
PStaticData::GetParticleUMass
double GetParticleUMass(const int &id)
Definition: PStaticData.cxx:962
PStaticData::NormParticleBRbyKey
bool NormParticleBRbyKey(Int_t key)
Definition: PStaticData.cxx:1138
PStaticData::GetDecayEmin
double GetDecayEmin(const int &idx)
Definition: PStaticData.cxx:866
PDataBase::GetEntry
Int_t GetEntry(const char *name)
Definition: PDataBase.cxx:464
listModes
void listModes(int id)
Definition: PStaticData.cxx:1732