#ifndef ALIJBASETRACK_H
#define ALIJBASETRACK_H
#ifndef ROOT_TObject
#include <TObject.h>
#endif
#include <iostream>
#include <TLorentzVector.h>
#include <TMath.h>
#include "AliJConst.h"
using namespace std;
class AliJBaseTrack : public TLorentzVector {
public:
enum { kIsIsolated, kNFlag };
AliJBaseTrack();
AliJBaseTrack(float px,float py, float pz, float e, Int_t id, Short_t ptype, Char_t charge);
AliJBaseTrack(const AliJBaseTrack& a);
AliJBaseTrack(const TLorentzVector & a);
virtual ~AliJBaseTrack(){;}
double EtaAbs(){ return TMath::Abs(Eta()); }
float GetTwoPiPhi() const {return Phi()>-kJPi/3 ? Phi() : kJTwoPi+Phi();}
TLorentzVector GetLorentzVector(){ return TLorentzVector(Px(), Py(), Pz(), E());}
Int_t GetID() const { return fID;}
Int_t GetLabel() const { return fLabel; }
Short_t GetParticleType() const { return fParticleType;}
ULong_t GetStatus() const { return fStatus; }
Short_t GetCharge() const { return fCharge; }
UInt_t GetFlags() const { return fFlags; }
Bool_t GetIsIsolated() const { return IsTrue(kIsIsolated);}
Int_t GetTriggBin() const { return fTriggID; }
Int_t GetAssocBin() const { return fAssocID; }
Double32_t GetTrackEff() const {
if(fTracEff==-1) { cout<<"AliJBaseTrack: Uninitilized track eff " <<endl; exit(-1);
} else return fTracEff; }
Bool_t IsInTriggerBin() const { return fTriggID>=0; }
Bool_t IsInAssocBin() const { return fAssocID>=0; }
Double_t GetWeight() const { return fWeight;}
Int_t GetMCIndex() const { return fMCIndex;}
void SetID (const int id){fID=id;}
void SetLabel (const Int_t label ){ fLabel=label; }
void SetParticleType(const Short_t ptype){ fParticleType=ptype; }
void SetStatus (const ULong_t status){ fStatus=status; }
void SetCharge (const Char_t charge){ fCharge=charge; }
void SetFlags (const UInt_t bits ){ fFlags=bits; }
void SetIsIsolated(Bool_t tf){ SetFlag( kIsIsolated, tf); }
void SetTriggBin(const int id){fTriggID = id;}
void SetAssocBin(const int id){fAssocID = id;}
void SetTrackEff(const Double32_t inEff){fTracEff = inEff;}
void SetWeight(Double_t weight) { fWeight = weight;}
void SetMCIndex(Int_t idx) { fMCIndex = idx;}
virtual void Print(Option_t *option="") const;
Bool_t IsTrue(int i ) const { return TESTBIT(fFlags, i); }
void SetFlag(int i, Bool_t t){ if(t){SETBIT(fFlags,i);}else{CLRBIT(fFlags, i);}}
AliJBaseTrack& operator=(const AliJBaseTrack& trk);
protected:
Int_t fID;
Int_t fLabel;
Short_t fParticleType;
Char_t fCharge;
ULong_t fStatus;
UInt_t fFlags;
Int_t fTriggID, fAssocID;
Double32_t fTracEff;
Int_t fMCIndex;
Double_t fWeight;
ClassDef(AliJBaseTrack,1)
};
#endif