// -*- mode: C++ -*-

//
// Pibero Djawotho <pibero@indiana.edu>
// Indiana University
// 4 October 2006
//

#ifndef Particle_h
#define Particle_h

// Local
class Track;

// ROOT
#include "TLorentzVector.h"
#include "TRefArray.h"

class Particle : public TObject {
public:
  Particle();
  Particle(const Particle& particle);
  Particle(Track* track1, Track* track2);
  ~Particle() {}

  int charge() const;
  double energy() const;
  double p() const;
  double pt() const;
  double eta() const;
  double phi() const;
  double y() const;
  double m() const;
  double mt() const;
  double cosTheta() const;
  TLorentzVector& momentum();
  TRefArray& daughters();
  bool level2() const;
  int l2Sim() const;

  void setL2Sim(int val) { mL2Sim = val; }
private:
  int mL2Sim;
  int mCharge;
  double mCosTheta;
  TLorentzVector mMomentum;
  TRefArray mDaughters;

  ClassDef(Particle, 2);
};
inline int Particle::l2Sim() const { return mL2Sim; }
inline int Particle::charge() const { return mCharge; }
inline double Particle::energy() const { return mMomentum.Energy(); }
inline double Particle::p() const { return mMomentum.Vect().Mag(); }
inline double Particle::pt() const { return mMomentum.Pt(); }
inline double Particle::eta() const { return mMomentum.Eta(); }
inline double Particle::phi() const { return mMomentum.Phi(); }
inline double Particle::y() const { return mMomentum.Rapidity(); }
inline double Particle::m() const { return mMomentum.M(); }
inline double Particle::mt() const { return mMomentum.Mt(); }
inline double Particle::cosTheta() const { return mCosTheta; }
inline TRefArray& Particle::daughters() { return mDaughters; }

#endif
