13.07.2015 Views

BABAR C++ Course Running the Examples - HEPHY

BABAR C++ Course Running the Examples - HEPHY

BABAR C++ Course Running the Examples - HEPHY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A Road SignParticle classWarning: prototype code is about to follow• experimental work by Paul Rensing before he leftSLAC• see <strong>BABAR</strong> Note 169 for a description• work is left unfinished• <strong>the</strong>re are some problems that need fixing• needs to be updated to latest CLHEP release• <strong>the</strong>re are some ideas for a better designIt is never<strong>the</strong>less useful to look at this code as isTake Lorentz vector and add to it(bfast/particle.h)class Particle : public HepLorentzVector{public:Particle() {_pdtEntry = 0; _charge = 0; _parent = 0; }Particle(HepLorentzVector &, PDTEntry *);Particle(const Particle &);virtual ~Particle() {}float charge() const { return _charge; }float mass() const { return mag(); }// more methods not shownprotected:float _charge; // units of ePDTEntry *_pdtEntry;HepAList _children;Particle *_parent;};• note one can inherit from a class which is an inheritedclass• added features are charge, pointer to entry in particledata table, list of children, and pointer to parent• member functions not shown support added features<strong>BABAR</strong> <strong>C++</strong> <strong>Course</strong> 140 Paul F. Kunz<strong>BABAR</strong> <strong>C++</strong> <strong>Course</strong> 141 Paul F. Kunz

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!