Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TParticleClassPDG.h
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 #ifndef TParticleClassPDG_hh
12 #define TParticleClassPDG_hh
13 
14 #include "TNamed.h"
15 #include "TObjArray.h"
16 
17 class TParticlePDG;
18 
19 class TParticleClassPDG : public TNamed {
20 public:
21 //------------------------------------------------------------------------------
22 // data members
23 //------------------------------------------------------------------------------
24 protected:
25  TObjArray* fListOfParticles; // list of (non-owned) particles
26 
27  TParticleClassPDG(const TParticleClassPDG& pcp): TNamed(pcp), fListOfParticles(pcp.fListOfParticles) { }
28  TParticleClassPDG& operator=(const TParticleClassPDG& pcp)
29  {if(this!=&pcp) {TNamed::operator=(pcp); fListOfParticles=pcp.fListOfParticles;}
30  return *this;
31  }
32 //------------------------------------------------------------------------------
33 // functions
34 //------------------------------------------------------------------------------
35 public:
36  // ****** constructors and destructor
37 
38  TParticleClassPDG(const char* name = 0);
39  virtual ~TParticleClassPDG();
40  // ****** access methods
41 
42  Int_t GetNParticles () {
43  return fListOfParticles->GetEntriesFast();
44  }
45 
46  TParticlePDG* GetParticle(Int_t i) {
47  return (TParticlePDG*) fListOfParticles->At(i);
48  }
49 
50  TObjArray* GetListOfParticles() { return fListOfParticles; }
51 
52  // ****** modifiers
53 
54  void AddParticle(TObject* p) { fListOfParticles->Add(p); }
55 
56  // ****** overloaded methods of TObject
57 
58  virtual void Print(Option_t* opt="") const; // *MENU*
59 
60  Bool_t IsFolder() const { return kTRUE; }
61  virtual void Browse(TBrowser* b);
62 
63  ClassDef(TParticleClassPDG,1) // PDG static particle definition
64 };
65 
66 #endif