Logo ROOT   6.10/09
Reference Guide
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) { }
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 
43  return fListOfParticles->GetEntriesFast();
44  }
45 
47  return (TParticlePDG*) fListOfParticles->At(i);
48  }
49 
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
An array of TObjects.
Definition: TObjArray.h:37
TParticleClassPDG(const TParticleClassPDG &pcp)
const char Option_t
Definition: RtypesCore.h:62
virtual void Print(Option_t *opt="") const
Print the entire information of this kind of particle.
virtual ~TParticleClassPDG()
destructor, class doesn't own its particles...
TParticleClassPDG & operator=(const TParticleClassPDG &pcp)
virtual void Browse(TBrowser *b)
browse this particle class
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TObject * At(Int_t idx) const
Definition: TObjArray.h:165
#define ClassDef(name, id)
Definition: Rtypes.h:297
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TObjArray * fListOfParticles
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
Definition: TNamed.cxx:42
Int_t GetEntriesFast() const
Definition: TObjArray.h:64
Description of the static properties of a particle.
Definition: TParticlePDG.h:19
TParticlePDG * GetParticle(Int_t i)
void AddParticle(TObject *p)
Mother of all ROOT objects.
Definition: TObject.h:37
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
void Add(TObject *obj)
Definition: TObjArray.h:73
const Bool_t kTRUE
Definition: RtypesCore.h:91
Utility class used internally by TDatabasePDG.
TObjArray * GetListOfParticles()