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

//
// Pibero Djawotho <pibero@indiana.edu>
// Indiana University
// 30 July 2007
//

#ifndef EMC_HIT_H
#define EMC_HIT_H

// Local
class Track;

// ROOT
#include "TObject.h"
#include "TVector3.h"
#include "TRefArray.h"

class EmcHit : public TObject {
public:
  EmcHit();
  EmcHit(const EmcHit& hit);
  ~EmcHit() {}

  int id() const;
  int adc() const;
  double energy() const;
  double pz() const;
  double pt() const;
  TVector3& momentum();
  TVector3& position();
  TRefArray& tracks();

  void setId(int id);
  void setAdc(int adc);
  void setPosition(const TVector3& position);
  void setMomentum(const TVector3& momentum);

private:
  int mId;
  int mAdc;
  TVector3 mPosition;
  TVector3 mMomentum;
  TRefArray mTracks;

  ClassDef(EmcHit, 1);
};

inline int EmcHit::id() const { return mId; }
inline int EmcHit::adc() const { return mAdc; }
inline double EmcHit::energy() const { return mMomentum.Mag(); }
inline double EmcHit::pz() const { return mMomentum.Pz(); }
inline double EmcHit::pt() const { return mMomentum.Pt(); }
inline TVector3& EmcHit::position() { return mPosition; }
inline TRefArray& EmcHit::tracks() { return mTracks; }

inline void EmcHit::setId(int id) { mId = id; }
inline void EmcHit::setAdc(int adc) { mAdc = adc; }
inline void EmcHit::setPosition(const TVector3& position) { mPosition = position; }
inline void EmcHit::setMomentum(const TVector3& momentum) { mMomentum = momentum; }


#endif
