00001 // @(#)root/eg:$Id: TParticleClassPDG.h 20882 2007-11-19 11:31:26Z rdm $ 00002 // Author: Pasha Murat 12/02/99 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 #ifndef TParticleClassPDG_hh 00012 #define TParticleClassPDG_hh 00013 00014 #include "TNamed.h" 00015 #include "TObjArray.h" 00016 00017 class TParticlePDG; 00018 00019 class TParticleClassPDG : public TNamed { 00020 public: 00021 //------------------------------------------------------------------------------ 00022 // data members 00023 //------------------------------------------------------------------------------ 00024 protected: 00025 TObjArray* fListOfParticles; // list of (non-owned) particles 00026 00027 TParticleClassPDG(const TParticleClassPDG& pcp): TNamed(pcp), fListOfParticles(pcp.fListOfParticles) { } 00028 TParticleClassPDG& operator=(const TParticleClassPDG& pcp) 00029 {if(this!=&pcp) {TNamed::operator=(pcp); fListOfParticles=pcp.fListOfParticles;} 00030 return *this; 00031 } 00032 //------------------------------------------------------------------------------ 00033 // functions 00034 //------------------------------------------------------------------------------ 00035 public: 00036 // ****** constructors and destructor 00037 00038 TParticleClassPDG(const char* name = 0); 00039 virtual ~TParticleClassPDG(); 00040 // ****** access methods 00041 00042 Int_t GetNParticles () { 00043 return fListOfParticles->GetEntriesFast(); 00044 } 00045 00046 TParticlePDG* GetParticle(Int_t i) { 00047 return (TParticlePDG*) fListOfParticles->At(i); 00048 } 00049 00050 TObjArray* GetListOfParticles() { return fListOfParticles; } 00051 00052 // ****** modifiers 00053 00054 void AddParticle(TObject* p) { fListOfParticles->Add(p); } 00055 00056 // ****** overloaded methods of TObject 00057 00058 virtual void Print(Option_t* opt="") const; // *MENU* 00059 00060 Bool_t IsFolder() const { return kTRUE; } 00061 virtual void Browse(TBrowser* b); 00062 00063 ClassDef(TParticleClassPDG,1) // PDG static particle definition 00064 }; 00065 00066 #endif