TDatabasePDG.h

Go to the documentation of this file.
00001 // @(#)root/eg:$Id: TDatabasePDG.h 29092 2009-06-19 09:31:49Z brun $
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 
00012 #ifndef ROOT_TDatabasePDG
00013 #define ROOT_TDatabasePDG
00014 
00015 #ifndef ROOT_TParticlePDG
00016 #include "TParticlePDG.h"
00017 #endif
00018 #ifndef ROOT_TParticleClassPDG
00019 #include "TParticleClassPDG.h"
00020 #endif
00021 
00022 class THashList;
00023 class TExMap;
00024 
00025 class TDatabasePDG: public TNamed {
00026 
00027 protected:
00028    static TDatabasePDG *fgInstance;        // protect against multiple instances
00029    THashList           *fParticleList;     // list of PDG particles
00030    TObjArray           *fListOfClasses;    // list of classes (leptons etc.)
00031    mutable TExMap      *fPdgMap;           //!hash-map from pdg-code to particle
00032 
00033    TDatabasePDG(const TDatabasePDG& db)
00034      : TNamed(db), fParticleList(db.fParticleList),
00035      fListOfClasses(db.fListOfClasses), fPdgMap(0) { }
00036 
00037    TDatabasePDG& operator=(const TDatabasePDG& db)
00038      {if(this!=&db) {TNamed::operator=(db); fParticleList=db.fParticleList;
00039      fListOfClasses=db.fListOfClasses;} return *this;}
00040 
00041    void BuildPdgMap() const;
00042 
00043 public:
00044 
00045    TDatabasePDG();
00046    virtual ~TDatabasePDG();
00047 
00048    static TDatabasePDG*  Instance();
00049 
00050    virtual TParticlePDG*   AddParticle(const char*  Name,
00051                                        const char*  Title,
00052                                        Double_t     Mass,
00053                                        Bool_t       Stable,
00054                                        Double_t     DecayWidth,
00055                                        Double_t     Charge,
00056                                        const char*  ParticleClass,
00057                                        Int_t        PdgCode,
00058                                        Int_t        Anti=-1,
00059                                        Int_t        TrackingCode=0);
00060 
00061    virtual Int_t  ConvertGeant3ToPdg(Int_t Geant3Number);
00062    virtual Int_t  ConvertPdgToGeant3(Int_t pdgNumber);
00063    virtual Int_t  ConvertIsajetToPdg(Int_t isaNumber);
00064 
00065    virtual TParticlePDG* AddAntiParticle(const char* Name, Int_t PdgCode);
00066 
00067    TParticlePDG  *GetParticle(Int_t pdgCode) const;
00068    TParticlePDG  *GetParticle(const char *name) const;
00069 
00070    TParticleClassPDG* GetParticleClass(const char* name) {
00071       if (fParticleList == 0)  ((TDatabasePDG*)this)->ReadPDGTable();
00072       return (TParticleClassPDG*) fListOfClasses->FindObject(name);
00073    }
00074 
00075    const THashList *ParticleList() const { return fParticleList; }
00076 
00077    virtual void   Print(Option_t *opt = "") const;
00078 
00079    Bool_t IsFolder() const { return kTRUE; }
00080    virtual void   Browse(TBrowser* b);
00081 
00082    virtual void   ReadPDGTable (const char *filename = "");
00083    virtual Int_t  WritePDGTable(const char *filename);
00084 
00085    ClassDef(TDatabasePDG,2)  // PDG particle database
00086 
00087 };
00088 
00089 #endif

Generated on Tue Jul 5 14:26:43 2011 for ROOT_528-00b_version by  doxygen 1.5.1