ROOT logo
/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice */

// Short comment describing what this class does needed!

// $Id: AliJBaseTrack.h,v 1.5 2008/05/08 15:19:52 djkim Exp $

///////////////////////////////////////////////////
/*
   \file AliJBaseTrack.h
   \brief
   \author J. Rak, D.J.Kim, R.Diaz (University of Jyvaskyla)
   \email: djkim@jyu.fi
   \version $Revision: 1.5 $
   \date $Date: 2008/05/08 15:19:52 $
   */
///////////////////////////////////////////////////

#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); // constructor
        AliJBaseTrack(const AliJBaseTrack& a);
        AliJBaseTrack(const TLorentzVector & a);
        virtual ~AliJBaseTrack(){;}    //destructor

        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; }        //MC, is primary flag
        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;

        // Handel BitsData
        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);}}

        // Operators
        AliJBaseTrack& operator=(const AliJBaseTrack& trk);

    protected:
        Int_t         fID;            // Unique track ID
        Int_t         fLabel;         // Unique track label for MC-Data relation
        Short_t       fParticleType;  // ParticleType 
        Char_t        fCharge;        // track charge for real data
        ULong_t       fStatus;        // reconstruction status flags or MC status 
        UInt_t        fFlags;         // store series of any boolen value.

        Int_t         fTriggID, fAssocID; //!   //id of trigger and assoc particle 
        Double32_t    fTracEff;           //!   //track efficiency
        Int_t         fMCIndex;           //!   //index of corresp. MC track
        Double_t      fWeight;            //!   //particle weight

        ClassDef(AliJBaseTrack,1)
};

#endif

 AliJBaseTrack.h:1
 AliJBaseTrack.h:2
 AliJBaseTrack.h:3
 AliJBaseTrack.h:4
 AliJBaseTrack.h:5
 AliJBaseTrack.h:6
 AliJBaseTrack.h:7
 AliJBaseTrack.h:8
 AliJBaseTrack.h:9
 AliJBaseTrack.h:10
 AliJBaseTrack.h:11
 AliJBaseTrack.h:12
 AliJBaseTrack.h:13
 AliJBaseTrack.h:14
 AliJBaseTrack.h:15
 AliJBaseTrack.h:16
 AliJBaseTrack.h:17
 AliJBaseTrack.h:18
 AliJBaseTrack.h:19
 AliJBaseTrack.h:20
 AliJBaseTrack.h:21
 AliJBaseTrack.h:22
 AliJBaseTrack.h:23
 AliJBaseTrack.h:24
 AliJBaseTrack.h:25
 AliJBaseTrack.h:26
 AliJBaseTrack.h:27
 AliJBaseTrack.h:28
 AliJBaseTrack.h:29
 AliJBaseTrack.h:30
 AliJBaseTrack.h:31
 AliJBaseTrack.h:32
 AliJBaseTrack.h:33
 AliJBaseTrack.h:34
 AliJBaseTrack.h:35
 AliJBaseTrack.h:36
 AliJBaseTrack.h:37
 AliJBaseTrack.h:38
 AliJBaseTrack.h:39
 AliJBaseTrack.h:40
 AliJBaseTrack.h:41
 AliJBaseTrack.h:42
 AliJBaseTrack.h:43
 AliJBaseTrack.h:44
 AliJBaseTrack.h:45
 AliJBaseTrack.h:46
 AliJBaseTrack.h:47
 AliJBaseTrack.h:48
 AliJBaseTrack.h:49
 AliJBaseTrack.h:50
 AliJBaseTrack.h:51
 AliJBaseTrack.h:52
 AliJBaseTrack.h:53
 AliJBaseTrack.h:54
 AliJBaseTrack.h:55
 AliJBaseTrack.h:56
 AliJBaseTrack.h:57
 AliJBaseTrack.h:58
 AliJBaseTrack.h:59
 AliJBaseTrack.h:60
 AliJBaseTrack.h:61
 AliJBaseTrack.h:62
 AliJBaseTrack.h:63
 AliJBaseTrack.h:64
 AliJBaseTrack.h:65
 AliJBaseTrack.h:66
 AliJBaseTrack.h:67
 AliJBaseTrack.h:68
 AliJBaseTrack.h:69
 AliJBaseTrack.h:70
 AliJBaseTrack.h:71
 AliJBaseTrack.h:72
 AliJBaseTrack.h:73
 AliJBaseTrack.h:74
 AliJBaseTrack.h:75
 AliJBaseTrack.h:76
 AliJBaseTrack.h:77
 AliJBaseTrack.h:78
 AliJBaseTrack.h:79
 AliJBaseTrack.h:80
 AliJBaseTrack.h:81
 AliJBaseTrack.h:82
 AliJBaseTrack.h:83
 AliJBaseTrack.h:84
 AliJBaseTrack.h:85
 AliJBaseTrack.h:86
 AliJBaseTrack.h:87
 AliJBaseTrack.h:88
 AliJBaseTrack.h:89
 AliJBaseTrack.h:90
 AliJBaseTrack.h:91
 AliJBaseTrack.h:92
 AliJBaseTrack.h:93
 AliJBaseTrack.h:94
 AliJBaseTrack.h:95
 AliJBaseTrack.h:96
 AliJBaseTrack.h:97
 AliJBaseTrack.h:98
 AliJBaseTrack.h:99
 AliJBaseTrack.h:100
 AliJBaseTrack.h:101
 AliJBaseTrack.h:102
 AliJBaseTrack.h:103
 AliJBaseTrack.h:104
 AliJBaseTrack.h:105