12 #include "RConfigure.h" 64 Warning(
"TDatabasePDG",
"object already instantiated");
67 gROOT->GetListOfSpecials()->Add(
this);
86 gROOT->GetListOfSpecials()->Remove(
this);
128 const char* ParticleClass,
136 printf(
" *** TDatabasePDG::AddParticle: particle with PDGcode=%d already defined\n",PDGcode);
141 charge, ParticleClass, PDGcode, Anti,
167 printf(
" *** TDatabasePDG::AddAntiParticle: can't redefine parameters\n");
175 printf(
" *** TDatabasePDG::AddAntiParticle: particle with pdg code %d not known\n", pdg_code);
249 switch(Geant3number) {
252 case 25 :
return -2112;
254 case 26 :
return -3122;
256 case 27 :
return -3222;
258 case 28 :
return -3212;
260 case 29 :
return -3112;
262 case 30 :
return -3322;
264 case 31 :
return -3312;
266 case 32 :
return -3334;
267 case 9 :
return -211;
268 case 33 :
return -15;
269 case 10 :
return 130;
271 case 11 :
return 321;
272 case 35 :
return 411;
273 case 12 :
return -321;
274 case 36 :
return -411;
275 case 13 :
return 2112;
276 case 37 :
return 421;
277 case 14 :
return 2212;
278 case 38 :
return -421;
279 case 15 :
return -2212;
280 case 39 :
return 431;
281 case 16 :
return 310;
282 case 40 :
return -431;
283 case 17 :
return 221;
284 case 41 :
return 4122;
285 case 18 :
return 3122;
287 case 19 :
return 3222;
288 case 43 :
return -24;
289 case 20 :
return 3212;
291 case 21 :
return 3112;
293 case 22 :
return 3322;
295 case 23 :
return 3312;
297 case 24 :
return 3334;
313 case -2112 :
return 25;
315 case -3122 :
return 26;
317 case -3222 :
return 27;
319 case -3212 :
return 28;
321 case -3112 :
return 29;
323 case -3322 :
return 30;
325 case -3312 :
return 31;
327 case -3334 :
return 32;
328 case -211 :
return 9;
329 case -15 :
return 33;
330 case 130 :
return 10;
332 case 321 :
return 11;
333 case 411 :
return 35;
334 case -321 :
return 12;
335 case -411 :
return 36;
336 case 2112 :
return 13;
337 case 421 :
return 37;
338 case 2212 :
return 14;
339 case -421 :
return 38;
340 case -2212 :
return 15;
341 case 431 :
return 39;
342 case 310 :
return 16;
343 case -431 :
return 40;
344 case 221 :
return 17;
345 case 4122 :
return 41;
346 case 3122 :
return 18;
348 case 3222 :
return 19;
349 case -24 :
return 43;
350 case 3212 :
return 20;
352 case 3112 :
return 21;
353 case 3322 :
return 22;
354 case 3312 :
return 23;
355 case 3334 :
return 24;
384 case -80 :
return -24;
386 case 230 :
return 311;
387 case -230 :
return -311;
388 case 330 :
return 331;
390 case -340 :
return 0;
391 case 440 :
return 441;
392 case 111 :
return 113;
393 case 121 :
return 213;
394 case -121 :
return -213;
395 case 221 :
return 223;
396 case 131 :
return 323;
397 case -131 :
return -323;
398 case 231 :
return 313;
399 case -231 :
return -313;
400 case 331 :
return 333;
401 case -140 :
return 421;
402 case 140 :
return -421;
403 case 141 :
return -423;
404 case -141 :
return 423;
405 case -240 :
return -411;
406 case 240 :
return 411;
407 case 241 :
return -413;
408 case -241 :
return 413;
410 case -341 :
return 0;
411 case 441 :
return 443;
414 case 250 :
return 511;
415 case -250 :
return -511;
416 case 150 :
return 521;
417 case -150 :
return -521;
418 case 350 :
return 531;
419 case -350 :
return -531;
420 case 351 :
return 533;
421 case -351 :
return -533;
422 case 450 :
return 541;
423 case -450 :
return -541;
425 case 1140 :
return 4222;
426 case -1140 :
return -4222;
427 case 1240 :
return 4212;
428 case -1240 :
return -4212;
429 case 2140 :
return 4122;
430 case -2140 :
return -4122;
431 case 2240 :
return 4112;
432 case -2240 :
return -4112;
433 case 1340 :
return 0;
434 case -1340 :
return 0;
435 case 3140 :
return 0;
436 case -3140 :
return 0;
437 case 2340 :
return 0;
438 case -2340 :
return 0;
439 case 3240 :
return 0;
440 case -3240 :
return 0;
441 case 3340 :
return 0;
442 case -3340 :
return 0;
443 case 1440 :
return 0;
444 case -1440 :
return 0;
445 case 2440 :
return 0;
446 case -2440 :
return 0;
447 case 3440 :
return 0;
448 case -3440 :
return 0;
449 case 1111 :
return 2224;
450 case -1111 :
return -2224;
451 case 1121 :
return 2214;
452 case -1121 :
return -2214;
453 case 1221 :
return 2114;
454 case -1221 :
return -2114;
455 case 2221 :
return 1114;
456 case -2221 :
return -1114;
457 case 1131 :
return 3224;
458 case -1131 :
return -3224;
459 case 1231 :
return 3214;
460 case -1231 :
return -3214;
461 case 2231 :
return 3114;
462 case -2231 :
return -3114;
463 case 1331 :
return 3324;
464 case -1331 :
return -3324;
465 case 2331 :
return 3314;
466 case -2331 :
return -3314;
467 case 3331 :
return 3334;
468 case -3331 :
return -3334;
469 case 1141 :
return 0;
470 case -1141 :
return 0;
471 case 1241 :
return 0;
472 case -1241 :
return 0;
473 case 2241 :
return 0;
474 case -2241 :
return 0;
475 case 1341 :
return 0;
476 case -1341 :
return 0;
477 case 2341 :
return 0;
478 case -2341 :
return 0;
479 case 3341 :
return 0;
480 case -3341 :
return 0;
481 case 1441 :
return 0;
482 case -1441 :
return 0;
483 case 2441 :
return 0;
484 case -2441 :
return 0;
485 case 3441 :
return 0;
486 case -3441 :
return 0;
487 case 4441 :
return 0;
488 case -4441 :
return 0;
491 case -12 :
return -11;
493 case -14 :
return -13;
495 case -16 :
return -15;
497 case -11 :
return -12;
499 case -13 :
return -14;
501 case -15 :
return -16;
502 case 110 :
return 111;
503 case 120 :
return 211;
504 case -120 :
return -211;
505 case 220 :
return 221;
506 case 130 :
return 321;
507 case -130 :
return -321;
508 case -20 :
return 130;
509 case 20 :
return 310;
512 case 1120 :
return 2212;
513 case -1120 :
return -2212;
514 case 1220 :
return 2112;
515 case -1220 :
return -2112;
516 case 2130 :
return 3122;
517 case -2130 :
return -3122;
518 case 1130 :
return 3222;
519 case -1130 :
return -3222;
520 case 1230 :
return 3212;
521 case -1230 :
return -3212;
522 case 2230 :
return 3112;
523 case -2230 :
return -3112;
524 case 1330 :
return 3322;
525 case -1330 :
return -3322;
526 case 2330 :
return 3312;
527 case -2330 :
return -3312;
549 default_name =
"pdg_table.txt";
556 FILE* file = fopen(fn,
"r");
558 Error(
"ReadPDGTable",
"Could not open PDG particle file %s",fn);
563 Int_t class_number, anti, isospin, i3, spin, tracking_code;
564 Int_t ich, kf, nch, charge;
565 char name[30], class_name[30];
566 Double_t mass, width, branching_ratio;
569 Int_t idecay, decay_type, flavor, ndau, stable;
572 while ( (input=getc(file)) != EOF) {
578 if (fscanf(file,
"%i",&ich)) {;}
580 if (fscanf(file,
"%s",name )) {;}
582 if (fscanf(file,
"%i",&kf )) {;}
584 if (fscanf(file,
"%i",&anti )) {;}
589 if (fgets(c,200,file)) {;}
592 if (fscanf(file,
"%i",&class_number)) {;}
594 if (fscanf(file,
"%s",class_name)) {;}
596 if (fscanf(file,
"%i",&charge)) {;}
598 if (fscanf(file,
"%le",&mass)) {;}
600 if (fscanf(file,
"%le",&width)) {;}
602 if (fscanf(file,
"%i",&isospin)) {;}
604 if (fscanf(file,
"%i",&i3)) {;}
606 if (fscanf(file,
"%i",&spin)) {;}
608 if (fscanf(file,
"%i",&flavor)) {;}
610 if (fscanf(file,
"%i",&tracking_code)) {;}
612 if (fscanf(file,
"%i",&nch)) {;}
614 if (fgets(c,200,file)) {;}
615 if (width > 1e-10) stable = 0;
635 while ( ((c_input=getc(file)) != EOF) && (ich <nch)) {
641 if (fscanf(file,
"%i",&idecay)) {;}
643 if (fscanf(file,
"%i",&decay_type)) {;}
645 if (fscanf(file,
"%le",&branching_ratio)) {;}
647 if (fscanf(file,
"%i",&ndau)) {;}
648 for (
int idau=0; idau<ndau; idau++) {
650 if (fscanf(file,
"%i",&dau[idau])) {;}
658 if (fgets(c,200,file)) {;}
664 if (fgets(c,200,file)) {;}
682 for (ich=0; ich<nch; ich++) {
686 for (
int i=0; i<ndau; i++) {
727 Error(
"WritePDGTable",
"Do not have a valid PDG particle list;" 728 " consider loading it with ReadPDGTable first.");
732 FILE *file = fopen(filename,
"w");
734 Error(
"WritePDGTable",
"Could not open PDG particle file %s",filename);
738 fprintf(file,
"#--------------------------------------------------------------------\n");
739 fprintf(file,
"# i NAME............. KF AP CLASS Q MASS WIDTH 2*I+1 I3 2*S+1 FLVR TrkCod N(dec)\n");
740 fprintf(file,
"#--------------------------------------------------------------------\n");
743 for(
Int_t i=0;i<nparts;++i) {
749 fprintf(file,
"%5i %-20s %- 6i ", ich, p->
GetName(), kf);
753 for(
Int_t j=0;j<nparts;++j) {
760 fprintf(file,
"%i 0\n",anti);
764 fprintf(file,
"%i ",anti);
765 fprintf(file,
"%i ",100);
768 fprintf(file,
"%.5le ",p->
Mass());
769 fprintf(file,
"%.5le ",p->
Width());
771 fprintf(file,
"%i ",(
Int_t)p->
I3());
773 fprintf(file,
"%i ",-1);
776 fprintf(file,
"%i\n",nch);
780 fprintf(file,
"#----------------------------------------------------------------------\n");
781 fprintf(file,
"# decay type(PY6) BR Nd daughters(codes, then names)\n");
782 fprintf(file,
"#----------------------------------------------------------------------\n");
783 for(
Int_t j=0;j<nch;++j) {
786 fprintf(file,
"%9i ",dc->
Number()+1);
790 fprintf(file,
"%3i ",ndau);
791 for (
int idau=0; idau<ndau; idau++) {
794 for (
int idau=0; idau<ndau; idau++) {
797 fprintf(file,
"%-10s ",dummy->
GetName());
799 fprintf(file,
"%-10s ",
"???");
virtual const char * GetName() const
Returns name of object.
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
TDatabasePDG()
Create PDG database.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
const char * ParticleClass() const
virtual ~TDatabasePDG()
Cleanup the PDG database.
virtual Int_t GetEntries() const
Int_t NDecayChannels() const
static const char * filename()
void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
TObject * FindObject(const char *name) const
Find object using its name.
TParticleClassPDG * GetParticleClass(const char *name)
TDecayChannel * DecayChannel(Int_t i)
return pointer to decay channel object at index i
virtual TParticlePDG * AddParticle(const char *Name, const char *Title, Double_t Mass, Bool_t Stable, Double_t DecayWidth, Double_t Charge, const char *ParticleClass, Int_t PdgCode, Int_t Anti=-1, Int_t TrackingCode=0)
Particle definition normal constructor.
static TDatabasePDG * Instance()
static function
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
The TNamed class is the base class for all named ROOT classes.
virtual TParticlePDG * AddAntiParticle(const char *Name, Int_t PdgCode)
assuming particle has already been defined
TParticlePDG * AntiParticle()
virtual void Print(Option_t *opt="") const
Print the entire information of this kind of particle.
Int_t DaughterPdgCode(Int_t i)
static Vc_ALWAYS_INLINE Vector< T > abs(const Vector< T > &x)
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
Int_t MatrixElementCode()
virtual void Browse(TBrowser *b)
browse data base
virtual Int_t ConvertIsajetToPdg(Int_t isaNumber) const
Converts the ISAJET Particle number into the PDG MC number.
void SetAntiParticle(TParticlePDG *ap)
TObjArray * fListOfClasses
Using a TBrowser one can browse all ROOT objects.
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
R__EXTERN TSystem * gSystem
THashList * fParticleList
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Int_t TrackingCode() const
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
void Warning(const char *location, const char *msgfmt,...)
void AddParticle(TObject *p)
virtual void ReadPDGTable(const char *filename="")
read list of particles from a file if the particle list does not exist, it is created, otherwise particles are added to the existing list See $ROOTSYS/etc/pdg_table.txt to see the file format
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
static RooMathCoreReg dummy
static TDatabasePDG * fgInstance
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
virtual Int_t ConvertGeant3ToPdg(Int_t Geant3Number) const
Converts Geant3 particle codes to PDG convention.
TParticlePDG * GetParticle(Int_t pdgCode) const
Get a pointer to the particle object according to the MC code number.
virtual Int_t WritePDGTable(const char *filename)
write contents of the particle DB into a file
void BuildPdgMap() const
Build fPdgMap mapping pdg-code to particle.
virtual void Add(TObject *obj)
Short_t Max(Short_t a, Short_t b)
virtual void Print(Option_t *opt="") const
Print contents of PDG database.
Double_t BranchingRatio()
virtual Int_t ConvertPdgToGeant3(Int_t pdgNumber) const
Converts pdg code to geant3 id.
This class stores a (key,value) pair using an external hash.
Int_t AddDecayChannel(Int_t Type, Double_t BranchingRatio, Int_t NDaughters, Int_t *DaughterPdgCode)
add new decay channel, Particle owns those...
const char * Data() const