Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TParticleClassPDG.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/eg:$Id$
0002 // Author: Pasha Murat   12/02/99
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 #ifndef TParticleClassPDG_hh
0012 #define TParticleClassPDG_hh
0013 
0014 #include "TNamed.h"
0015 #include "TObjArray.h"
0016 
0017 class TParticlePDG;
0018 
0019 class TParticleClassPDG : public TNamed {
0020 public:
0021 //------------------------------------------------------------------------------
0022 //     data members
0023 //------------------------------------------------------------------------------
0024 protected:
0025    TObjArray*  fListOfParticles;  // list of (non-owned) particles
0026 
0027    TParticleClassPDG(const TParticleClassPDG& pcp): TNamed(pcp), fListOfParticles(pcp.fListOfParticles) { }
0028    TParticleClassPDG& operator=(const TParticleClassPDG& pcp)
0029    {if(this!=&pcp) {TNamed::operator=(pcp); fListOfParticles=pcp.fListOfParticles;}
0030        return *this;
0031    }
0032 //------------------------------------------------------------------------------
0033 // functions
0034 //------------------------------------------------------------------------------
0035 public:
0036    // ****** constructors  and destructor
0037 
0038    TParticleClassPDG(const char* name = 0);
0039    ~TParticleClassPDG() override;
0040    // ****** access methods
0041 
0042    Int_t   GetNParticles () {
0043       return fListOfParticles->GetEntriesFast();
0044    }
0045 
0046    TParticlePDG* GetParticle(Int_t i) {
0047       return (TParticlePDG*) fListOfParticles->At(i);
0048    }
0049 
0050    TObjArray* GetListOfParticles() { return fListOfParticles; }
0051 
0052    // ****** modifiers
0053 
0054    void AddParticle(TObject* p) { fListOfParticles->Add(p); }
0055 
0056    // ****** overloaded methods of TObject
0057 
0058    void    Print(Option_t* opt="") const override; // *MENU*
0059 
0060    Bool_t IsFolder() const override { return kTRUE; }
0061    void   Browse(TBrowser* b) override;
0062 
0063    ClassDefOverride(TParticleClassPDG,1)  // PDG static particle definition
0064 };
0065 
0066 #endif