Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TParticleClassPDG.cxx
Go to the documentation of this file.
1 // @(#)root/eg:$Id$
2 // Author: Pasha Murat 12/02/99
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /** \class TParticleClassPDG
13  \ingroup eg
14 
15 Utility class used internally by TDatabasePDG
16 */
17 
18 #include "TDecayChannel.h"
19 #include "TParticlePDG.h"
20 #include "TParticleClassPDG.h"
21 
22 ClassImp(TParticleClassPDG);
23 
24 ////////////////////////////////////////////////////////////////////////////////
25 ///default constructor
26 
27 TParticleClassPDG::TParticleClassPDG(const char* name): TNamed(name,name)
28 {
29  fListOfParticles = new TObjArray(5);
30 }
31 
32 ////////////////////////////////////////////////////////////////////////////////
33 /// destructor, class doesn't own its particles...
34 
35 TParticleClassPDG::~TParticleClassPDG() {
36  delete fListOfParticles;
37 }
38 
39 
40 
41 ////////////////////////////////////////////////////////////////////////////////
42 ///
43 /// Print the entire information of this kind of particle
44 ///
45 
46 void TParticleClassPDG::Print(Option_t *) const
47 {
48  printf("Particle class: %-20s",GetName());
49  if (fListOfParticles) {
50  int banner_printed = 0;
51  TIter next(fListOfParticles);
52  TParticlePDG *p;
53  while ((p = (TParticlePDG*)next())) {
54  if (! banner_printed) {
55  p->Print("banner");
56  banner_printed = 1;
57  }
58  p->Print("");
59  }
60  }
61 }
62 
63 ////////////////////////////////////////////////////////////////////////////////
64 ///browse this particle class
65 
66 void TParticleClassPDG::Browse(TBrowser* b)
67 {
68  if (fListOfParticles) fListOfParticles->Browse(b);
69 }
70 
71